By default, WordPress uses URLs like this http://example.com/?p=123. This URL structure is not SEO friendly.
This is why most WordPress site owners use Pretty Permalinks, which is a term used for SEO friendly URLs in WordPress. These SEO friendly Permalinks contain post, category, tag, title in the URL, allowing you to use Keywords inside your URLs.
In this article, we’ll show you how to set up Permalinks in WordPress and make your website more SEO friendly.
To set up Permalinks on your WordPress site, simply go to Settings » Permalinks. There you will see a number of options to choose from:
Choosing a Permalink Structure
Most WordPress SEO experts agree that the best permalink structure is the one that uses the post name in the URL. The default options allow you to choose from day and name, month and name, and post name URL structure. There is also an option to have numeric permalinks. Numeric permalinks are better than the ugly URLs but they are not considered as good as the URLs with post name.
You need to choose one of the default options by clicking the radio button next to it and save your settings.
Apart from the default options, you can also create your own Permalink structure using special tags. The available tags that you can use are:
- %year% – Four digit year of post, e.g. 2014.
- %monthnum% – Two digit month of post, e.g 07.
- %day% – Two digit day of the mont, e.g. 18.
- %hour%
- %minute%
- %second%
- %post_id% – The unique ID number of the post example, 123.
- %postname% – The title of the post sanitized to be used in post URL, e.g. how-to-set-up-permalinks-in-wordpress
- %category% – Category name sanitized to be used in URL. e.g. wordpress-tutorials.
- %author% – Author name sanitized to be used in URL. e.g. syed-balkhi.
WordPress allows you to use whatever structure you want. However, you are required to use %postname% and %post_id% for your individual post. These tags are unique identifier that help WordPress locate the post from the database. Same goes for your category archives. They must have %category% in them.
We recommend reviewing which permalink structure you prefer before you start publishing content. Note that if you change your permalink structure at a later date, your post and page URL’s will also change. Therefore if you change your permalink structure in the future, you will need to set up 301 redirect in your .htaccess file in order to redirect users to proper content.
Troubleshooting User-Friendly Permalink Structure
In rare cases, your server may not have this module enabled. In that case you will see a notice in your Permalink settings page informing you that WordPress cannot write to the .htaccess file.
WordPress Permalinks need mod_rewrite module installed on your web server. WordPress also uses a special server configuration file called .htaccess to use pretty permalinks. All our recommended WordPress hosting providers have set up their servers with necessary configuration to run WordPress. This means your server should already be configure to use Apache’s mod_rewrite module.
The two most common causes for permalinks not working are:
1. Incorrect File Permissions
In correct file permissions stop WordPress from creating or writing to the .htaccess file. To solve this issue you would need to connect to your website using an FTP client. Make sure your FTP client is set to show hidden files. You will see a .htaccess file in your website’s root directory. If you do not see it, then you need to create one. After that simply copy and paste the rewrite code shown in Permalinks settings into your .htaccess file and save it.
2. mod_rewrite Module is Not Available on Your Server
For permalinks to work, you need mod_rewrite module enabled on your webserver. If they are not then you need to contact your hosting service provider and ask them to enable it for you.
We hope this article helped you set up Permalinks in WordPress. It will certainly provide the SEO boost your site deserves.
If you’re an affiliate marketer, then you may also want to learn How to Cloak Affiliate Links in WordPress (the Easy Way).
Affiliate links usually look like this:
This makes the links look unattractive and, frankly, a bit sloppy. By cloaking your links you can change that. Compare the URL above with the following:
You can use plugins like Pretty Links and ThirstyAffiliates for this. It’s a real game changer.
FAQs on Setting Up Pretty Links in WordPress
Why should I set up “pretty” permalinks?
Pretty permalinks make your URLs more user-friendly and SEO-friendly. They are easier to read, remember, and share, contributing to a better user experience and improved search engine rankings.
How do I change permalinks in WordPress?
- Go to your WordPress dashboard
- Navigate to Settings » Permalinks
- Choose the “Post name” option or customize your structure
- Click “Save Changes” to apply the new permalink structure
Can I customize my permalink structure?
Yes, you can customize your permalink structure. WordPress provides options like “Day and name,” “Month and name,” and custom structures where you can define your own format.
Will changing permalinks affect my existing content?
Yes, changing permalinks can impact existing links. WordPress automatically sets up redirects for most changes, but it’s recommended to check and update internal links and notify search engines of the changes.
What is the best permalink structure for SEO?
The “Post name” permalink structure is generally considered the most SEO-friendly. It includes the title of your post in the URL, making it clear and relevant to search engines.
Can I change permalinks on an established website without issues?
Yes, you can change permalinks on an established website, but be cautious. Use a tool like AIOSEO to set up proper redirects, update internal links, and inform search engines to avoid any negative impacts on your site’s SEO.
How do I create a custom permalink structure?
In the WordPress dashboard, go to Settings » Permalinks. Choose the “Custom Structure” option and enter your desired format using placeholders like %postname% for the post name. Click “Save Changes” to implement the custom structure.
That’s all we have for you. You may also want to see our tutorial on Affiliate Marketing Made Simple for Beginners: Step by Step.
A Really Nice information if you gave us in communication. Thanks
You probably have a .htaccess file in your directory but you may not see it if you don’t have “show hidden files” checked in your cPanel. Open cPanel -> file manager -> settings(upper right hand corner) make sure show hidden files (dot files) is checked
A very good tip! 🙂 Thanks for sharing.
Hello IsItWp,
I have configured and setup as you have shown in article but still my articles are ranking in Google domain.com/category ,may I know how to solve this issue ??
Does WordPress not create an .htaccess automatically? If not, you need to create a blank one in your WordPress root directory and set the permissions to 666 so it can write to it.
thanks for the info, I manage to complete the first step( changing my permalink Date and Name option, however, I dont know how to create .htaccess, should I open the cpanel and create a folder for that(in my public html)?
thank you
No problem, glad you liked it.
Thanks for the tips. Your notes are very clear and easy to follow.
Nick