The perfect WordPress SEO permalink structure
In the past, we received a lot of 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:
[code]/%postname%/[/code]
And with the category prefixed:
[code]/%category%/%postname%/[/code]
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.
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. In the video below, Google’s John Muller gives you some advice on changes in your file extensions:
If you need to change your URLs, for example, if you move to a new content management system that doesn’t allow you to use .html URLs at all, keep in mind that this change would be a restructuring of your website. You would need to redirect the old URLs to the new ones.
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 on 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:
[code]RedirectMatch 301 /d{4}/d{2}/d{2}/(.*) https://staging-platform.yoast.com/$1[/code]
For Nginx, you can use the following snippet in your site configuration:
[code]location ~ /d{4}/d{2}/d{2}/(.*) {
rewrite ^(.*)$ https://staging-platform.yoast.com/$1 permanent;
}[/code]
If you decide to change existing permalinks always test this first in a staging environment. And do note that exiting social shares will be lost if you change it.
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 »
WordPress for beginners series
Coming up next!
-
Event
WordCamp Netherlands 2024
November 29 - 30, 2024 Team Yoast is at Sponsoring WordCamp Netherlands 2024! Click through to see who will be there, what we will do, and more! See where you can find us next » -
SEO webinar
Webinar: How to start with SEO (November 19, 2024)
19 November 2024 Learn how to start your SEO journey the right way with our free webinar. Get practical tips and answers to all your questions in the live Q&A! All Yoast SEO webinars »
22 Responses to The perfect WordPress SEO permalink structure