Table of Contents[Hide][Show]
A permalink structure is very important for any website. It affects the ranking of any website in Search Engine Result Pages (SERPs).
If the permalink structure of your website is short and simple, the chances of getting ranked in search results high.
On the other hand, if the permalink structure is confusing, not search engine friendly then you might lose your website’s ranking in search engines.
This guide covers an in-depth guide for WordPress permalink structure. But before that, let’s understand what permalink is all about.
Permalink
Permalinks are nothing but part of the web address. It comes after the domain name and directs to specific page or post. It is always been a topic of concern that what permalink structure should be preferred.
Quite often, I have found people searching for WordPress permalink structure guide.
This post details the why and how to change permalink structure without losing the traffic that you already have on your website.
Why should you change your WordPress permalink structure?
The default permalink structure uses the post ID as a unique identifier in the URL:
https:// www.yourdomain.com/?p=123
It’s not a good practice to keep website URLs that contain numbers, special characters or any id. I always advise people to get rid of the date in their permalink structure. It makes the website URL a bit shorter and it is always good to have short URLs for Search Engine Optimization (SEO) purpose.
On the other hand, having a date in your permalink structure has proven to diminish the Click-through Rate (CTR). Moreover, people are just not likely to click on a result that’s two or more years old.
I have heard many people saying that including just a /%postname%/
can cause a serious performance issue when you have a lot of pages on your blog. Well, it was a real issue a year ago but luckily WordPress has resolved this issue while releasing WordPress 3.3. So you can easily continue to /%postname%/
and stop worrying about the performance issue.
Changing WordPress Permalink Structure
There are many options available under Permalink common setting. You can choose the permalinks structure according to your need. You just need to go to Settings -> Permalinks and select the permalink structure.
E.g., If you have a news website that you can prefer day and name structure.
/%year%/%monthnum%/%day%/%postname%/
Available WordPress Permalink Structures
In case, you’ve chosen to use a “Custom Structure” then there are several other useful structures are available to you:
%year%
= the year of the post (eg. 2016)%monthnum%
= month of the year (eg. 08)%day%
= day of the month (eg. 30)%hour%
= hour of the day (eg. 12)%minute%
= minute of the hour (eg. 09)%second%
= second of the minute (eg. 36)%postname%
= post slug (post title)%post_id%
= the ID of the post (try to avoid)%category%
= category slug of where the post is stored%author%
= author name
You can use any of these tags listed above to customise your permalink. Make sure to end your permalink structure with %postname%. Here are some other good examples of permalink structures:
/%category%/%postname%
= yoursite.com/category/post-title/%post_id%/%postname%
= yoursite.com/123/post-title/%year%/%postname%
= yoursite.com/2015/post-title
If you don’t see post name under permalink settings, it means you are still using an older WordPress version. I would suggest you upgrade it to WordPress 3.3 or above.
What happens when you have set this all up but it is not working?
In most cases, you are probably missing the web.config
file in the root folder of your website (Windows Hosting) or .htaccess file
in the root of your WordPress website (Linux Hosting). Now you need to update either web.config
or .htaccess file
based on your web hosting type.
1. Web.config
configuration (Windows Hosting)
Once you are done with the above steps WordPress will notify you to update the web.config
file inside the root directory of your website. Follow these steps:
- Go to the root directory of your website
- Open web.config in any of the text editor.
- Now replace all the code inside web.config with the following code:
2. .htaccess
File configuration (Linux Hosting)
Open your FTP client, connect to your website root folder using FTP details and make sure that .htaccess file is available there and it contains the following code:
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
Check for more awesome resources on WordPress.
Once you complete all these steps, you will find your new permalink structure working quite well. If you find any difficulty, feel free to contact me and do put your views in the comment section below.
Thanks for reading! 🙂