The URLs of the content you publish on your WordPress website are known as permalinks. Permalinks are what people enter into their browser address bar to view one of your pages (they are the permanent link to a single page). They are also what search engines and other websites use to link to your website. Due to this, they are very important.
You can change the structure of your permalinks at any time. However doing this will changee the URL of your pages. This can cause your search engine traffic and referral traffic to drop considerably as visitors are presented with 404 page errors instead of the page they want to view.
301 redirects can stop the impact of a change in permalink structure,; however, it is still better to configure your website with the permalink structure you want from the beginning.
There are a few options for what permalink structures WordPress has available, and each of them has its own benefits. No matter what, having clean URLs on your website is very important.
The Default Permalink Structure
WordPress permalink settings can be found in the main settings menu of the WordPress admin area (i.e. https://www.yourwebsite.com/wp-admin/options-permalink.php).
In the screenshot below, you can see the five custom permalink structures that WordPress displays as common settings.
WordPress automatically enables the Plain permalink structure after you install WordPress. The number used in the default permalink advises WordPress where the content can be found in your database. To be more specific, the number refers to the ID of the table row in the wp_posts table of your WordPress database (the table prefix for your website will be different if you changed it during the installation process). For example, http://www.yourwebsite.com/?p=50 would refer to the 50th row in your website’s wp_posts table and http://www.yourwebsite.com/?page_id=100 would refer to the 100th.
The default permalink structure is not user-friendly. It is better to refer a visitor to a URL such as http://www.yourwebsite.com/big-news-story/ than http://www.yourwebsite.com/?page_id=54367.
The part at the end of the permalink, i.e. ?p=123, is known as a query string. The question mark is a separator and the part that follows afterwards is the identifying data. In this case, we are identifying content from the database to display.
Despite many people suggesting otherwise, search engines such as Google can and do index URL’s that contain query strings (billions of indexed pages online are testament to this). However, search engines do prefer you to use “friendlier” URLs. And they’re ranked higher in results because of their semantic URL structure.
In their Search Engine Optimization Starter Guide, Google make it clear that a structured URL structure with keywords will make it easier for them to crawl your pages:
Creating descriptive categories and filenames for the documents on your website can not only help you keep your site better organized, but it could also lead to better crawling of your documents by search engines. Also, it can create easier, “friendlier” URLs for those that want to link to your content.
Visitors may be intimidated by extremely long and cryptic URLs that contain few recognizable words. URLs like (1) can be confusing and unfriendly. Users would have a hard time reciting the URL from memory or creating a link to it. Also, users may believe that a portion of the URL is unnecessary, especially if the URL shows many unrecognizable parameters. They might leave off a part, breaking the link.
Some users might link to your page using the URL of that page as the anchor text. If your URL contains relevant words, this provides users and search engines with more information about the page than an ID or oddly named parameter would.
So to summarize Google’s points above :
- URLs with a structured hierarchy will make it easier for them to crawl your pages
- Visitors may cut off part of your URL when copying a link as the additional code might seem unnecessary
- URLs that contain relevant keywords will help you rank better in search engines
Due to these reasons, it is better to use one a more search engine friendly permalink structure on your WordPress website.
A Search Engine Friendly Permalink Structure
Apart from the Plain permalink structure, all of the permalink structures that WordPress offers are search engine friendly (though %post_id% does not utilize keywords). These permalink structures are sometimes referred to as “Pretty Permalinks” or “Clean URLs.”
In order to use these permalink structures, WordPress needs to modify your website’s .htaccess file. WordPress will generally do this automatically. If it cannot, you need to add the code to your .htaccess file manually.
You can find a guide on how to do this on WordPress.org. If you find that guide difficult to follow, I recommend speaking to your web hosting company about this issue. They will be able to add the necessary code to your .htaccess file or make your .htaccess file writable so that WordPress can automatically change your permalink structure.
When you choose one of the five common permalink structures that WordPress suggests, you will see the custom structure field change. The different tags that you see listed in this field are known as structure tags. There are ten structure tags available to you.
- %postname% – The post slug of your post
- %post_id% – The unique ID of a post
- %category% – The category a post was assigned to
- %year% – The year the article was published
- %monthnum% – The month the article was published
- %day% – The day the article was published
You can also use the following tags (though very few websites do):
- %hour% – The hour the article was published
- %minute% – The minute the article was published
- %second% – The second the article was published
- %author% – The author name
When looking to use “Pretty Permalinks,” you must include either the post name (%postname%) or the post ID (%post_id%). The post slug refers to the last part of your permalink. It can be edited directly through the post editor. Keep in mind that the keywords you use in your post slug can influence your search engine rankings.
Technically, you could use a permalink structure such as month and name without using %postname% or %post_id% (i.e. /%year%/%monthnum%/). This would only function correctly if you published one article per month. If two articles were published in a given month, they would both have the same URL. The result is that all articles from that month would be published on the same URL, therefore you would be unable to actually view any post on its own.
In other words, you need to use either %postname% or %post_id% to ensure that the URLs of posts and pages are unique.
What is the Best WordPress Permalink Structure?
The ten permalink structure tags that are available theoretically allow you to create a large number of unique permalink structures. They’re not all useful, however. (Who uses hours, minutes, adn seconds in a URL?) In practice, most WordPress websites use of the following permalink structures:
- Post Name (/%postname%/ -> www.yourwebsite.com/big-news/) – Post name is very popular with WordPress owners because it generates short memorable URLs. I use it on my personal blog. It may not suitable for websites that publish multiple times per day on the same topic. It could become difficult to come up with unique post slugs. For example, a tech blog might use the post slug /iphone-8/ for their first iPhone 8 news story; however they could not use that post slug ever again. So it had better be an amazing cornerstone article.
- Category and Name (/%category%/%postname%/ -> www.yourwebsite.com/sports/big-news/) – Category and name is the permalink structure that the Elegant Themes blog uses. It creates a hierarchical structure of content on your website and ensures that visitors know what kind of post they are viewing. It also doesn’t hurt that it stuffs the most keywords into your URL than any other option; which (apparently) is great from an SEO point of view.
- Full Date and Name (/%year%/%monthnum%/%day%/%postname%/ -> www.yourwebsite.com/2014/05/01/big-news/) – High traffic news websites can publish dozens of articles per day. That is why most websites with a high posting frequency use the day and name permalink structure. It ensures their page URLs contain the year, month, and day, that an article was published. So you can absolutely use /iphone-8/ on a daily basis, just not more than once a day.
- Year, Month, and Name (/%year%/%monthnum%/%postname%/ -> www.yourwebsite.com/2014/05/big-news/) – Year, Month, and Name is another popular choice. It generates URLs that are two characters shorter than day and name.
The post name and category and name permalink structures are also popular because they do not specify the date an article was published within the URL. If you publish evergreen content (or content that never goes out of date or is still be relevant for many years), you don’t want to use dates in your URL. However, many website owners take advantage of this and completely remove the publication date from all their articles, which can be frustrating as a reader as you do not know whether the information on the page is still valid. (For example, SEO Trends to Watch This Year that was published in 2013 and not updated is probably a waste of your time, but the publish date may be nowhere to be found).
The Best WordPress Permalink Structure
If you search for “best WordPress permalink structure,” you will find many people stating that post name is the best permalink structure for WordPress. Few people actually back up this view with facts. With many bloggers, it appears to merely be their own personal preference.
In fact, that applies to most if not all of the popular URL structures. From an SEO point of view, I have seen nothing to suggest that any of the options mentioned previously have an advantage over the others. If one permalink structure was better for SEO, everyone would be using it. Google’s semantic ranking algorithm, however, does indicate you’ll want something with keywords in it, be it category or post name.
My first article referred to an article on Weberz from 2009 that stated that many SEO experts give wrong advice regarding WordPress permalinks. Back then, with the issue with post name still causing performance issues (fixed in WP 3.3 in 2011, mind you), many people recommended started your permalink structure with a numeric field such as the year or post ID. However, people who were involved with optimizing search engines stressed that any performance issues were negligible anyway; therefore, it made more sense to use a permalink structure that was better for SEO.
These days, with the post name bug long behind us, there seems to be no performance issues linked with any common permalink structures. And to my knowledge, there is no SEO benefit of using one permalink over another. So the best WordPress permalink structure is really the one that suits your site the best. Except for Plain.
What WordPress Permalink Structure to Use?
I would recommend using the day and name option (/%year%/%monthnum%/%day%/%postname%/) if you have a news website that publishes multiple articles per day. It is what top blogs such as Engadget and Mashable use.
For everything else, I would use post name (/%postname%/) or category and name (/%category%/%postname%/).
I use post name myself with all of my websites. I am not an SEO expert, though the idea that inserting categories into your post URLs to boost rankings seems plausible, as it allows you to define more keywords in the URL.
Categories are not something I like to attach to a URL as it restricts you from ever modifying your categories. I have changed the names of my post categories two or three times over the last few years. If I had been using category and name as my permalink structure, all of my URLs would have been broken. I therefore prefer not to include category in permalinks as it gives me the option of moving posts to a different category or renaming a category at a later date.
Customizing the Category and Tag Base
At the bottom of the permalink settings page you will see optional settings for your category base and tag base. The default values for these fields are category and tag.
With the default settings, if you have a category on your website called WordPress, the URL of the WordPress category archives would be http://www.yourwebsite.com/category/wordpress/. Likewise, if you have a tag called Themes, the tag archive URL for that tag would be http://www.yourwebsite.com/tag/themes/.
Changing these fields allows you to change the URLs that are used for archives. For example, you could change the category base to cat and the tag base to topic. In our example, this would generate the archive URLs http://www.yourwebsite.com/cat/wordpress/ and http://www.yourwebsite.com/topic/themes/.
Your permalink structure dictates how your website URLs are constructed. As such, it is something that you should review before you launch your website.
From an SEO and performance point of view, there does not seem to be any major benefits to choosing one permalink structure over another. Therefore, it really comes down to your own preference.
Remember, it is in your best interest to keep the same permalink structure active for the life of your site. If you do decide to change for any reason, use a redirection plugin such as Redirection to ensure that you do not lose any traffic. It doesn’t matter how pretty your permalinks are if all your visitors ever see is a 404 page.
If you have any questions or comments or suggestions about the best WordPress permalink structure, toss them in the comments! We would love to hear your thoughts and experiences.
Article thumbnail image by Tack Tack / shutterstock.com