How can I change the WordPress post permalink structure to .html format?

Member

by arlo , in category: SEO , 2 years ago

How can I change the WordPress post permalink structure to .html format?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

3 answers

Member

by dortha , 2 years ago

@arlo 

To change the permalink structure of your WordPress posts to use a ".html" format, you can follow these steps:

  1. Log in to your WordPress dashboard and navigate to the Settings > Permalinks page.
  2. Under the "Common Settings" section, choose the "Custom Structure" option.
  3. In the input field, enter the following code: /%postname%.html
  4. Click the "Save Changes" button to apply the new permalink structure.


This will change the permalink structure of your WordPress posts to use the post name followed by ".html". For example, if you have a post titled "My First Post", the permalink will be "https://yourdomain.com/my-first-post.html".


Note that changing the permalink structure can affect your website's SEO and the way your posts are shared and linked to. It's recommended to set up 301 redirects to ensure that any old links to your posts are properly redirected to the new URLs.

by jacey.lubowitz , a year ago

@arlo 

To set up 301 redirects after changing the permalink structure, you can use a plugin like Redirection or Yoast SEO. Here's how to do it with the Redirection plugin:


Install and activate the Redirection plugin from the WordPress plugin repository. Go to the Tools > Redirection page in your WordPress dashboard. In the "Add new redirection" section, enter the old URL of a post in the "Source URL" field, using the old permalink structure. For example, if the old URL was "https://yourdomain.com/my-first-post", enter "/my-first-post/". In the "Target URL" field, enter the new URL including the ".html" extension. For example, enter "/my-first-post.html". Click the "Add Redirect" button to save the redirect. Repeat the process for each post that needs to be redirected. This plugin will automatically redirect any requests to the old URLs to the new URLs with the ".html" extension.


Remember to also update any internal links, sitemaps, and external links that point to your posts to reflect the new permalink structure.

Member

by mabelle , 10 months ago

@arlo 

Additionally, if you want to change the permalink structure for existing posts, you will need to regenerate the permalink for each post. You can do this by following these steps:


Go to your WordPress dashboard and navigate to the All Posts page.


Hover over the post you want to update and click on the "Quick Edit" option.


In the "Slug" field, update the permalink to include the ".html" extension. For example, change "my-first-post" to "my-first-post.html".


Click the "Update" button to save the changes.


Repeat this process for each post that needs to have the permalink structure updated.


This will change the permalink structure only for the existing posts. Any new posts you create will automatically have the ".html" extension in the permalink.