permalink_structure_fi

How to change your WordPress permalink structure

How to change your WordPress permalink structure

November 17th, 2016 – 22 Comments

At Yoast, whenever we do a website review, we frequently recommend people change their permalink structure. In this post, we’ll explain why you should consider changing your permalink structure and how to go about it.

Why change your WordPress permalink structure?

A common thing we see in permalink structures are the usage of dates. For websites that post content that is related to current events, such as news sites, this makes perfect sense. However, for most blogs, the content is usually “timeless” as it tends to cover subjects that doesn’t relate to a specific date in time.

Using dates in your permalink structure also tends to have another side-effect, namely a lower CTR for older posts that may very well still be relevant. Whenever someone sees a result in Google with a date pointing back two years ago, they’ll be less likely to click that result. Seeing as Google uses this CTR for page rankings, it might be a very good idea to change your permalink structure to something more appealing to your visitors! If you want more information, you should read our post on WordPress SEO URL / Permalink considerations.

Get the most out of Yoast SEO, learn every feature and best practice in our Yoast SEO for WordPress training! »

Yoast SEO for WordPress training$ 99 - Buy now » Info

Changing WordPress permalink structure

There are two steps in changing your WordPress permalink structure. The first step is easy: go to Settings -> Permalinks and select Post name:

Changing your permalink settings

But what about all those old posts that still have dates in their permalink? With this handy tool, you can easily have a redirect generated that can be placed in your .htaccess file. This will point posts using the old permalink structure, to the new one. 

Please note that the tool currently only supports Apache-based servers and not Nginx.

After copying the redirect over to your .htaccess file, you should go out and test if everything is working properly. If the redirect doesn’t seem to be working, it could mean that you’re not allowed to use RedirectMatch on your Apache server.

If you don’t have proper rights to edit your .htaccess file or can’t use RedirectMatch, you can also consider using our Yoast SEO Premium plugin. The built-in Redirect Manager will automatically create a redirect for you whenever you alter the permalink of a post to reflect the newly chosen structure.

Read more: ‘WordPress SEO: the ultimate tutorial’ »


22 Responses to How to change your WordPress permalink structure

  1. Joshua T Flowers
    By Joshua T Flowers on 27 November, 2016

    Great write up. I think it would be pretty easy to add Nginx to your generator (or at least to the article). For example, to redirect the year/month format you would just add:

    rewrite “/([0-9]{4})/([0-9]{2})/(.*)” http://yourdomain.com/$3 permanent;

    For year/month/day:

    rewrite “/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)” http://yourdomain.com/$4 permanent;

    And archives:

    rewrite “/archives/(.*)” http://yourdomain.com/?p=$1 permanent;

    • Ben Vaassen
      By Ben Vaassen on 29 November, 2016

      Thanks for the suggestion! I’ve passed your information to the right team.

  2. Baju Wanita
    By Baju Wanita on 24 November, 2016

    Nice tips. thank you joost.

  3. Duncan William
    By Duncan William on 23 November, 2016

    This is a great article. I’ve been struggling to find answers to resolve permalink issues on my blog but hopefully these ideas can help. I’m having issues with canonicalisation too, but that’s a different story… it would be great to have a resource on that too…

  4. Warren
    By Warren on 21 November, 2016

    Thx, that’s what I need. I’m puzzled about my website’s link structure.

  5. Adrian
    By Adrian on 21 November, 2016

    This is a great article. It is very important to be choosing a post name or custom name setting for all your permalinks especially when you’re wanting to achieve better rankings in your SEO campaign.

    Thank you for the write up, will definitely check back to view your most recent blog articles. Keep it up!

  6. Kurnia Kwik
    By Kurnia Kwik on 19 November, 2016

    Why makes things complicated with htaccess file? There is SEO redirection WP plugin that make things simpler.

  7. Shirley Farenkopf
    By Shirley Farenkopf on 18 November, 2016

    The explanation is too tecnical. I can t anderstand it. I can t make any use with it.

  8. Shirley Farenkopf
    By Shirley Farenkopf on 18 November, 2016

    I coud not aderstand it!!! Sorry.

  9. Gary Kopycinski
    By Gary Kopycinski on 18 November, 2016

    So, I run a news site. Should I keep the dates in the URL, or lose them? We have 60,000+ published posts, so that would generate one heck of an .htaccess file, I suspect.

    • Thomas
      By Thomas on 20 November, 2016

      It’s only one small rule in the .htaccess file actually (assuming you’re removing dates from your URLs) b/c it’s a pattern that can be tested for and matched. In other words the tool checks for something like /YYYY/MM/DD/POST-NAME/ and does a 301 redirect to /POST-NAME/

      I’ve done it before with no loss of ranking or other issues a few times. That said, I wouldn’t expect to see drastic ranking improvements, and if you runa news site which posts timely news it’s probably not worth it.

  10. jogos online
    By jogos online on 18 November, 2016

    thing we see in permalink structures are the usage of dates. For websites that post content that is related to current events, such as news sites, this makes perfect sense.

  11. Ben
    By Ben on 18 November, 2016

    Awesome post…You’ve been great Joost. Thanks

  12. ron
    By ron on 18 November, 2016

    great article. Changing the URL structure is a simple yet effective tool, especially if you’re looking at creating a “timeless” post

  13. Stephanie Craig
    By Stephanie Craig on 18 November, 2016

    Does the redirect keep the social shares count?

    • Thomas
      By Thomas on 20 November, 2016

      No, it doesn’t :(

      Social tools usually use the full URL to count shares, so if you change the structure globally (remove dates) you do lose the social share counts as they think it’s new content.

  14. Amar
    By Amar on 18 November, 2016

    You have excellent point there Joost, dates in permalink can be confusing. As you may know, many posts are ageless. It can also lead to lower CTR.

    However, I’m not sure if we change permalink structure now, what happens to all those 1,000 odd posts. Which are quite popular. Don’t you think google will rank then lower, as and when you change permalink?

    Plus .htaccess file will be so big to add all those redirects?

    • Deepak Gupta
      By Deepak Gupta on 26 November, 2016

      Hello,
      You don’t need to enter a redirect for each single post in .htaccess. However, hust a single line of code in the .htacces will do the magic, for example: RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(?!page/)(.+)$ http://www.YourBlog.com/$4.

      Or, as alternate, if you are an Yoast Premium subscriber, you can use redirect in the plugin itself.

      Either way works fine, just a matter of choice.

    • Deepak Gupta
      By Deepak Gupta on 26 November, 2016

      Hello,
      You don’t need to enter a redirect for each single post in the .htaccess. However, just a single line of code in the .htaccess will do the magic, for example: RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(?!page/)(.+)$ http://www.YourBlog.com/$4.

      Or, as an alternate, if you are an Yoast Premium subscriber, you can use redirect in the plugin itself.

      Either way works fine, just a matter of choice.

  15. John
    By John on 18 November, 2016

    Hi Joost. Great article. As a Premium subscriber we could use either method. Which one performs better though please – Yoast redirect or .htaccess? Thanks. John

  16. Adeel Sami
    By Adeel Sami on 17 November, 2016

    Hello, Joost!

    Exactly my point!

    I am not a fan of date-based permalinks but of the post name.

    True that I do not click on the search result dating back to months or years.

    Though with post name, even it is written back in the time the users will still be clicking on it due to there’s no indication of the date.

    So, thank you for covering up this for us!

    ~ Adeel


Check out our must read articles about Analytics