If you have landed on this post you definitely want to change your WordPress website’s URL structure by adding .html extension after the slug at the end of the URL for some reason. Unfortunately, You have no way of changing the URL by editing the slug in your WordPress post or page because of the sanitize_title_with_dashes() function.
Some people change this because they believe it’s a good factor for ranking better when it comes to SEO. The other reason is moving a simple HTML site to a WordPress website & still, you need to keep your previous URLs because you’ve already published them on several websites. There may be other reasons to change this too. However, we’ll learn how to change your WordPress Post & Page URL by adding .html at the end.
Add .html at the end of the WordPress Post url
If you need to add .html at the end of your WordPress Post URL. Follow these steps.
- Login to your website’s WordPress dashboard.
- Go to Settings >> Permalinks
- Under Permalink Settings set Custom Structure for URL by removing slash “/” at the end of it & insert .html
- Save Changes & Go to a post to check the change.
Add .html at the end of the WordPress Page url
Although you have changed your post URL structure, it wouldn’t add .html extension after the page URL. Here what you can do to add .html after your WordPress page url slug too.
- Login to your website’s WordPress Dashboard.
- Go to Plugins >> clek Add New
- Search for the Plugin “html after url”
- Install & Activate the plugin
Hope this will be helpful whatever the purpose of changing your WordPress website url structure. Don’t forget to share & leave your feedback under. Thank you..
One more thing, If you want to add .php after WordPress slug at the end of the URL without a slash (/) you can read it here: How to add .php extension to WordPress URL.