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 »
Buy now » InfoShould 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’ »