Adding HTML to Permalinks

By default, WordPress uses a URL structure that doesn't include file extensions like .html. Nevertheless, it is worth considering the potential advantages and disadvantages of deviating from this rule and including extensions into the permalinks.

Many top-ranking websites on search engines may include links that lack the .html and.php extensions. In most cases, adding them to your new URLs is not necessary from an SEO standpoint.

Although this is a general rule, there are certain situations when it may be beneficial. A good example of this is when you have switched your store from Magento to WooCommerce or plan to do so soon.

Add html to permalinks

As previously stated, WordPress does not automatically append .html to standard URLs. If you need this feature, you do not need any additional plugins and you can enable it directly from the WordPress admin dashboard.

Please keep in mind that adding .html will affect all links that already exist. If you want to preserve the .html in some URLs but not add it to new content items, continue to the next section.

It is extremely straightforward and you can make it work with only a few clicks.

  1. Navigate to Settings > Permalinks using the sidebar menu.
  2. Select the "Custom Structure" option.
  3. Add .html suffix to the end of input field
Adding .html to WordPress URL via Settings
You may use this with different combinations of parameters by appending .html to the end of the input field. The screenshot just shows the most common permalink configuration.

Although there are a variety of ways to add html to a WordPress URL, Permalink Manager seems to be the fastest and most straightforward, particularly if you are not familiar with programming.

Unlike the default settings, the changes to the permalink format do not automatically affect all URLs. You can use this to append .html to old content and then modify the permalink format once more to ensure that no new content contains the .html suffix.

The instructions below apply to WooCommerce permalinks, but you may do the same with other content types in a similar manner. If you want to append the file extension to your URL addresses, go to the "Permastructures" section and use the permalink format editor.

"Permastructures" section

The procedure is quite simple. Find the content type where the file extension should be added to the permalinks and enter it at the end of the input field.

WooCommerce permalinks, like Magento's, may contain a.html extension.
WooCommerce permalinks, like Magento's, may contain a .html extension.

If you want apply the new format to existing content and append the extension to the old URLs, use the "Regenerate/reset" tool. More information on how to regenerate custom permalinks may be found in a separate article.

From now on, all new permalinks will end with .html file extension. If needed, you can individually tweak each of them using "URI Editor".

URI Editor
The Permalink Manager will automatically assign the default URI as a custom permalink for new posts and terms.

Does It Matter for SEO if the URL Ends With an Extension?

The answer depends on whether or not your website is listed with the extensions in the URLs. Changing the URLs, which involves removing the file extension, can potentially result in a loss of traffic. That being said, every modification that may impact SEO has to be carefully analyzed beforehand.

What Does Google Recommend?

If this is not enough to persuade you, read on. This subject has been already addressed in one of the videos on the Google Search Central YouTube channel. According to John Mueller in the video, Google does not care whether URLs terminate in .html, .php, .asp, or have no file extensions at all.

However, if your Google ranking is strong, keeping the URLs the same after the Magento to WooCommerce migration is a good idea from both an SEO and UX standpoint. Therefore, keeping the .html extension in your shop permalinks after migrating makes sense.

It is generally not necessary to include the ".html" file extension at the end of your permalinks (also known as URLs). In fact, many content management systems, including WordPress, do not use the ".html" extension by default.

It does not seem that using file extensions like .html, .php, or .aspx in the URLs, improves the website's search engine ranking. Therefore, it is recommended to use permalinks without them, as this ensures that the URLs are readable and usable.

In other words, the file extension does not matter when it comes to SEO optimization. Search engines do not consider file extensions for ranking pages, so include them in URLs serves no use.

Migrating From Different CMS

All of the above applies to websites and content that have not yet been ranked. In a specific case, though, it might be advantageous to include the file extension in your URLs. This is necessary if you wish to keep your pages' original URL structure while moving them to WordPress from another CMS.

If your Magento store URLs ended in .html and you are switching to WordPress, you may want to keep the same structure after the migration so that your customers can still find your products. It may be difficult, however, to maintain your original permalink structure using simply WordPress's built-in features. Permalink Manager may be the most straightforward answer to this issue.

You can use the plugin to recreate the original permalink structure of your Magento shop by removing the WooCommerce rewrite bases added to native permalinks. Simultaneously, you may add .html to the URLs of products and product categories.

Go up