the perfect wordpress seo permalink

The perfect WordPress SEO permalink structure

The perfect WordPress SEO permalink structure

February 17th, 2017 – 23 Comments

In the past we received a lot questions regarding optimizing your WordPress SEO URL / permalink structure. Questions ranging from whether you should have the category in your permalink structure to the length of your slugs. In this post, we’ll address some of these questions and attempt to give you a better understanding of your permalink structure.

The ideal WordPress SEO URL structure

At Yoast, we recommend using a simple and clear permalink structure. Ending your URL with the post name is the preferred method and optionally you can prefix the post name with the category, which results in one of the two following permalink structures:

/%postname%/

And with the category prefixed:

/%category%/%postname%/

For an added bonus, we recommend adding your main keyword somewhere in the post’s name. When checking out the snippet preview in our plugin, you’ll see your keyword emphasized in the URL if it’s been detected in your slug (see image below).

What about using dates?

Using dates in your URL never had many benefits. When you add dates to your permalink structure, you automatically ‘date’ your posts. People will naturally look for posts with a more recent date, assuming that they contain the best information. However, sometimes older post can hold very valuable information, but won’t get the same amount of clicks due to their age.

Should I use the category in my permalink structure?

If your domain name is nice and short and you use short, yet descriptive category names, you can easily include a category in your permalink structure which can benefit your website, but beware: if you end up with a lengthy slug and category name, it will make sharing the URL more difficult and won’t have much added value in Google.

If you decide to use categories in your permalink structure, make sure that you only select one category per post. For some more information regarding using categories in your permalink structure, I advise you to watch the following video by Matt Cutts.

Optimize your site for search & social media and keep it optimized with Yoast SEO Premium »

Yoast SEO for WordPress pluginBuy now » Info

Should I add .html to my permalink structure?

In terms of SEO and ranking, there is little benefit to keeping the .html extension present in your URLs. However, in the video below, Matt explains that there might be some other advantages to keeping the file extensions present in your permalink structure.

The discussion whether or not you should forcibly add .html (or any other extension) can be ended very quickly: Don’t do it. It won’t help you and if you add certain extensions such as .exe, it can actually hurt your rankings.

My blog is in Google News. Don’t I need numbers in the URL?

The short answer here is: no. Back in the day, Google News required you to use a three digit number in your URLs in order to be included in the News index. A way around this was to have a separate XML sitemap. However, since September 2015, both the three digit unique number and XML sitemap are no longer required.

Should my focus keyword always be the first keyword in the URL?

It might help slightly, but if your focus keyword is present in the first few words, you’ll be fine. Matt explains this at great length in the following video.

How many words should I use in my slug?

In this interview with Matt Cutts, Matt mentions the following regarding the length of your slug:

If you can make your title four- or five-words long – and it is pretty natural. If you have got a three, four or five words in your URL, that can be perfectly normal. As it gets a little longer, then it starts to look a little worse. Now, our algorithms typically will just weight those words less and just not give you as much credit.

Should you change your URL structure for better SEO?

You might expect that the answer to this question would be a simple yes. However, if you’ve been blogging for a while, you might not want to make any drastic decisions. Have you been using dates in your permalink structure for the past few years? Then it might be wise to not switch to a structure without them. If you only just started then switching won’t cause you much harm and might even be a huge beneficial step.
However, if you’re still using the “old style” urls (?p=) then it’d be wise to switch regardless of how long you’ve been blogging. This will greatly improve your blog’s potential to be found in Google’s search results.

If you do decide to get rid of dates in your permalink structure, you can add the following redirect to your .htaccess file (if you’re on Apache) to ensure that the old URL (/yyyy/mm/dd/%postname%/) points to the new one:

RedirectMatch 301 /d{4}/d{2}/d{2}/(.*) https://yoast.com/$1

For Nginx, you can use the following snippet in your site configuration:

location ~ /d{4}/d{2}/d{2}/(.*) {
rewrite ^(.*)$ https://yoast.com/$1 permanent;
}

The perfect WordPress SEO URL

Overall, permalink structures won’t differ much from website to website if done correctly. We advise that you make sure your permalink structure is properly set before avidly writing posts. If you do decide to change your permalink structure over time, make sure you properly redirect users from the old structure to the new one.

Read more: ‘How to change your WordPress permalink structure’ »


23 Responses to The perfect WordPress SEO permalink structure

  1. Maddo
    By Maddo on 2 March, 2017

    Great tips, I wanted to change my permalink structure at http://windows10top.com/ and found this article to be more than awesome. thanks

  2. JD
    By JD on 28 February, 2017

    I have used your seo plugin on many websites and I gotta tell you that you guys are the best. Oh and your right….. adding dates on permalinks doesn’t do a thing for your seo. What’s the point in adding them in the first place.

  3. Design Point
    By Design Point on 24 February, 2017

    Thank you for the great blog. Some great SEO friendly tips provided along with Matt Cutts providing some interesting points when optimising your website.

  4. diseño web Tijuana
    By diseño web Tijuana on 23 February, 2017

    Thank you for the information, I will try to put your advice into practice on our website

    An apology for my bad english
    regards

  5. Gurjit singh
    By Gurjit singh on 23 February, 2017

    Please advise is the seo friendly
    /%category%/%postname%.html/

    http://youmegeek.com/computer/use-gmail-offline-mac-pc-chromebook.html/

  6. Patrick
    By Patrick on 22 February, 2017

    Thanks for the url date snippet for the .htaccess. Would have saved me some time if i thought of this earlier ;-)

  7. vitamin
    By vitamin on 22 February, 2017

    It’s odd because the article mentions, “make sure that you only select one category per post.”

    However, it this post (https://yoast.com/wordpress-seo/), there is more than one category! Both “Technical SEO” and “WordPress”

    ::confusing:: Thoughts?

    • vitamin
      By vitamin on 22 February, 2017

      oops… I see the difference. The Category isn’t being used in the permalink structure. //

  8. Sally
    By Sally on 20 February, 2017

    Quote: “If you do decide to get rid of dates in your permalink structure, you can add the following redirect to your .htaccess file (if you’re on Apache) to ensure that the old URL (/yyyy/mm/dd/%postname%/) points to the new one:
    RedirectMatch 301 /d{4}/d{2}/d{2}/(.*) https://yoast.com/$1

    But what do you add to the .htaccess file if you want to change from day and name to custom?: http://www.yoururl.com/2017/02/20/sample-post/ to custom: http://www.yoururl.com/%category%/%postname%/

  9. Mizarstvo Svetelj
    By Mizarstvo Svetelj on 20 February, 2017

    This was very helpful, I made a lot of mistakes with categories and tags. Yoast SEO plugin helps you make the right decisions, thanks!

    • An
      By An on 22 February, 2017

      I used only Postname for my structure on my Website , i love yoast . Everything are so easy with that .

  10. Freebookiebets4u
    By Freebookiebets4u on 20 February, 2017

    Hi guys

    The information shared on this page has been very helpful in helping me choose what type of URL string to use on our site.

    Thank you so much!

  11. Made Of Carbon Fiber
    By Made Of Carbon Fiber on 20 February, 2017

    Thank you, I was just wondering how to improve my permalinks. Now I got a good guideline!

  12. Roger Sievers
    By Roger Sievers on 20 February, 2017

    Very timely we’re in the process of relaunching our website and was wondering if we needed to think about a change in URL structure.

  13. Bandela
    By Bandela on 19 February, 2017

    Hi Joost,

    Thanks alot for writing this up and sharing your expertise. This will be very handy for my new blog that I have just launched, https://www.yodruggist.co.za

    Quick question: For the base url of the blog, should it be /%postname%/ or /blog/%postname%/

    Thank you in advance.

  14. ScholarshipJamaica
    By ScholarshipJamaica on 19 February, 2017

    Hey Team Yoast,
    Thank you for this article. I have always had this issue in deciding the best permalink to adopt on my website. I am now in the process of making some changes.

    Thank you,
    Chris

  15. Randy
    By Randy on 19 February, 2017

    Thanks so very much for the great info and I am about to do some changing to my permalinks on my new site. Thanks!!

  16. YZ DESIGNS
    By YZ DESIGNS on 19 February, 2017

    This really helps, especially the video on Does the position of keywords in the URL affect ranking?

    I have to admit I have obsessed in the past as to what position my keywords should take on my URL’s, so thanks for clearing this up.

  17. Helios Suns Klub
    By Helios Suns Klub on 19 February, 2017

    This is just what I was looking for, my permalinks were a complete mess!

  18. Hock Your Ride Australia
    By Hock Your Ride Australia on 19 February, 2017

    Hello Yoast team,
    That was a very helpful post for my new business.
    Thank you very much – permalinks are very important.

  19. Tobias
    By Tobias on 18 February, 2017

    Hello Yoast Team,
    do I have to set manually a “/” at the end of my URL or is wordpress doing this automatically? I normally always to this but now I your tool shows two (//) in the snippet preview at the end of the URL.

    Best regards,
    Tobias

  20. Windows Support
    By Windows Support on 18 February, 2017

    Hii, Thanks for the sharing nice posting with us. i’m really impressed.
    Windows Support

  21. Mike Grossman
    By Mike Grossman on 17 February, 2017

    It’s nice to have that one finally cleared up Joost, with video clips from Google itself. Nice article, thank you.


Check out our must read articles about Analytics