BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

How to change Permalink Structure in WordPress

Last Updated: November 2, 2022 by Chaitanya Singh | Filed Under: SEO

Changing permalink structure is an easy task but doing it properly without losing traffic & SEO is important thing. In this post we are gonna see what are the ways to change permalink structure in WordPress without any issues (Redirection, 404 errors).

Last Post: Best Permalink Structure for WordPress SEO

For first time change: If you are changing the default WordPress permalink structure (like this one: https://beginnersbook.com/?p=123) then you won’t need to use any of the below method as the WordPress itself will take care for all the 301 redirects to new posts/pages.

For others permalinks you have two ways to do it –

1) Permalink migration using WordPress plugin – This method is useful if you do not want to change permalink structure for the existing posts but for new posts.

2) Manually modifying .htaccess file – This method would change the structure for all the posts/pages, irrespective of whether its new or old.

Permalink Structure migration using WordPress plugin

The plugin mentioned below is no longer active. However the htaccess codes are still valid. We would also like to mention that changing a permalink structure is not a good idea, if you are not new or have a established website. This will definitely hamper your traffic, even if you setup correct 301 redirects.

We will be using Advanced Permalinks plugin for this task.

Step 1: Download the plugin from: Advanced WordPress Permalinks (link removed, plugin is not active) and Activate it.

Step 2: In WordPress dashboard go to Settings » Permalinks, you would see a screen, which would be having 4 tabs at the top (by default there is no tab but it will appear once you have the above plugin activated on the website).

Step 3: Here we will see two cases –

Case 1: Change permalinks for all the existing and coming posts

Select the new permalink structure as shown below. This action will change the permalinks for the posts/pages as per the selected one but there are few issues which will occur –

  1. On accessing the old url – result in 404 page not found error
  2. SEO will lose for old url – loss in page rank and seo benefits so the ranking will suffer.

Solution: To avoid above two issue, we need to setup a 301 redirect (also known as permanent redirect) from old url to new url. For this only we are using the plugin.

Wordpress permalinks

Choose the “migration” at the top the screen would look like below. Give your old permalink structure and click Add as shown below. This action will setup as 301 redirect from old permalink structure to new permalink structure.

Case 2: Change permalinks for all the existing and coming posts

In that case, instead of selecting the “migration” tab use the “Posts” tab as shown below. Specify the new permalink structure and the range of post ids for which you want the new structure to be applicable. In that way you can just leave the old existing posts as it is.

Manually modifying .htaccess file

If you don’t want to use a plugin then you can do it by yourselves. All you have to do is first select the preferred permalink structure in Settings » Permalinks as we did in step 3 above and then add 301 redirects in .htaccess file (from old url to new url, in order to avoid 404 errors and traffic loss).

You may want to change the structure to http://your-domain.com/%postname%/ (which is the best, as per me) then select this one in permalink settings and add the below code in .htaccess file.

Note: All the below redirects will work only if your new permalink structure is http://your-domain.com/%postname%/

a) Old permalink: http://domain.com/%year%/%monthnum%/%day%/%postname%/

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://domain.com/$4

b) for http://domain.com/%year%/%monthnum%/%postname%/

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$ http://domain.com/$3

c) for http://domain.com/archives/%post_id%

RedirectMatch 301 ^/archives/(d+)$ http://domain.com/?p=$1

d) for http://domain.com/%category%/%postname%

RedirectMatch 301 ^/([^/]+)/([^/]+)$ http://domain.com/$2

e) for http://domain.com/?p=123

No need to do anything, WordPress itself will setup redirects for you!!.

You can also try Yoast’s tool to generate 301 redirects while changing permalink structure.

Top Related Articles:

  1. LSI Keywords Simple Yet Very Powerful
  2. The Best Permalink Structure for WordPress SEO

About the Author

I have 15 years of experience in the IT industry, working with renowned multinational corporations. Additionally, I have dedicated over a decade to teaching, allowing me to refine my skills in delivering information in a simple and easily understandable manner.

– Chaitanya

Comments

  1. Benjamin says

    April 22, 2014 at 7:29 AM

    Hi Chaitanya, thank you for the nicely structured post and the recommendation of this tool. I tested 2 other plugins first but they had no effect. This now has the desired one. BUT: It redirects with a 302, not a 301 which I would like to have, since all the redirects should be permanent and not temporary. Do you know how to modify the plugin?

    thx in adavance,
    Benjamin

    Reply
  2. koushik says

    September 11, 2014 at 4:32 PM

    In my website I am planning to change the url to have “post/%post-Title%” instead of just the “%post-Title%”.

    Looking forward to this tutorial to make the change successfully. Thanks for sharing.

    Reply
  3. Sander Kooger says

    November 3, 2014 at 11:58 AM

    Hey,

    I want to change the permalinks from Advanced WordPress Permalinks /%postname%-%year%-%monthnum%-%day%/ to /%postname%

    How do i acomplish this without loosing backlinks?

    Thanx

    PS the plugin is really old does it still work?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2012 – 2025 BeginnersBook . Privacy Policy . Sitemap