Posted in: WordPress Tutorials

How to Add .html Extension to WordPress Post URLs (Permalinks)?

Do you want to add .html to all your posts URL in WordPress website? For instance, you want to have a URL like https://wpflux.com/awesome-url-permalink.html instead of the default one. So, how to change the permalink URL for posts in WordPress blog or website?

Within the settings panel. WordPress allows you to easily modify the permalink, or permanent links, to the posts. You can choose to have a post URL with just an ugly search query or make it prettier with date, month, year, post slug, post ID, etc. For this, you need to access the Permalinks settings.

  1. Log in to your WordPress site dashboard
  2. Go to Settings > Permalinks settings page
  3. Choose the desired permalink URL structure
  4. For adding .html to the end of URLs, simply add “.html” at the end of the URL structure.
  5. Suggested URL structures for adding .html at the end
    • /%post_id%-%postname%.html
    • /%postname%.html

It is highly recommend that your WordPress peermalink URL structure has the POST ID in the beginning or at the end of the URL. Why? Post IDs are unique to each post, which means the post article that needs to be displayed can be picked from the database easily without having to search. If the post URL structure is limited to the post name, the right post can be displayed only after searching for the match from the list of post titles. Now, this can be a hassle if the website has thousands of posts.

 

Comments (2) on "How to Add .html Extension to WordPress Post URLs (Permalinks)?"

  1. I was searching for this & satisfied with the answer. But why its needed to add .html at the end of permalink?
    Thanks in advance!

Comments are closed.