Permalinks are the urls of pages and individual posts published on your WordPress websites. Name Permalink is short for “Permanent Link” – meaning these links can always be used to access your pieces of content. In some cases, default permalinks do not have any suitable context for it. As a result, users may be less inclined to visit the page, and search engines less inclined to rank it.
WordPress permalink by default has the URL structure https://yourwebsite.com/?p=123.
This default permalink structure is bad because it offers no clue about the post. The user only gets to know what the post is about by clicking on the link.
If you’re launching a new WordPress site, you’ll need to change your permalink structure the user and SEO friendly way. Also, if you have an established WordPress site, and you want to set its permalinks, then this tutorial is for you. We’ll show you the right way to go about it.
In this article:
- What is a Permalink in WordPress?
- Importance of Good Permalinks
- Considerations Before Setting Your Permalinks
- How to Set Pretty WordPress Permalink (Recommended)
- How To Setup Custom WordPress Permalinks
- Editing Permalink for Posts and Pages
- What is 301 Redirect?
What are WordPress Permalinks?
Permalinks are web addresses to blog posts and pages. WordPress creates web addresses for every post or page that you create. They are permanent assets and are not expected to change. However, you can customize permalink structure if the need arises.
Permalinks consist of your domain name and the link slug. For example, in the link https://yoursite.com/woocommerce/how-to-install-woocommerce, “https://yoursite.com” is your domain, while “/woocommerce/how-to-install-woocommerce” is the slug.
WordPress has different permalink options to choose from.
- Ugly permalink: WordPress creates a default permalink structure that contains numbers called the ID . This post ids are unique and identifies every post or page you create. For example, https://yoursite.com/?p=99. This type of permalink is default on all WordPress sites. Then again, this type of permalink settings is vague and is not good.
- Pretty permalink: These are SEO friendly URLs. They contain words that refer to the post or page. They look like this https://yoursite.com/name-of-post.
This WordPress permalink structure requires mod_rewrite module in Apache (or a similar module in other web servers).
- Almost pretty permalink: Similar to the pretty permalinks. Almost pretty permalink usually have the index.php prefix. For example, the link above would be https://yoursite.com/index.php/name-of-post.
This permalink structure can work without the mod-rewrite module.
Importance of Good Permalinks in WordPress
Permalinks in WordPress help users identify each content on your site. If it contains relevant words, users and search engines will have more information about the page. For example, “http://yoursite.com/attractive-and-charismatic-lady“ gives a hint on what to expect. Also, search engines use the context of permalink to rank content for search queries.
When you share good permalinks, you position your site to get more traffic. Human visitors are confident about clicking links that contain context to a post.
Considerations Before Setting Your Permalinks
You may want to avoid extremely long permalinks, and obscure ones as well. WordPress allows for a combination of structure tags in the URL structure. Such as dates in your permalinks, ‘author’, ‘category’ etc. These combinations can result in long permalinks.
Obscure permalinks are URLs that contain few recognizable words. Using obscure links could be intimidating, confusing, and unfriendly.
Another thing to consider is the use of numbers only, on your URL. It does not give any clue about the post and is not good for search engines either.
We’ve put together a list of other things to consider before setting your permalink.
- Always use post names on your permalink. A post name on your permalink makes it simple and easy to memorize. It is good for humans and search engines.
- Depending on the type of site you have, date tags in your site URL may be a great idea. For example, if you have a news website, it helps to categorize news by time. However, it may not be suitable for other types of sites.. Information on any blog post that carries an old timestamp is perceived as old. Very few people will click on the search results that contain a date from years ago, even if the information is still relevant and correct.
- Categories enable you to organize your site content. If you have a site with multiple, distinct categories, displaying them in your permalinks make it easy to identify content from the url. But it makes your permalink longer.
How to Set Pretty WordPress Permalink (Recommended)
We will now show you how to set up the pretty WordPress permalink structure.
Go to your WordPress admin area, and then go to Settings>>Permalinks.
Next, choose the “Post name” option. You may choose any other option listed on the page, depending on what your site is all about.
Then click Save Changes.
Your WordPress permalink is set.
Now you want to test to see if this structure works properly.
To do this, create a new post on your site, enter a topic, and save it as a draft. When done, look at the permalink created. It should look like this https://yourdomain.com/name-of-post.
How To Setup Custom WordPress Permalinks
You may decide to specify a custom structure. This enables you to choose the tags you want to add to the url of your pages and posts.
For example, you may want every link to contain the author name, category, and post name (such as https://yoursite.com/michael/woocommerce/how-to-install-woocommerce-payment-gateways).
To do this, login to your Dashboard and go to Settings>Permalinks.
Now choose your desired structure tags (in this case %author%, %category%, and %postname%), and then Save Changes.
This custom WordPress permalink structure will now be used for all posts and pages on your WordPress site.
Editing Permalink for Posts and Pages
Sometimes, you may want to use a different slug for some posts on your site. Something other than the default WordPress slug. We will show you how to do this.
If you use the post name structure, you can easily edit the WordPress generated slug. It is usually the title of the post.
On the admin area of your site. Navigate to Posts >All Posts>select an existing post. Click on the permalink text box to edit the WordPress generated slug.
Customize the slug by editing it as you wish.You may want to include SEO keywords in the url.
Click Update to save the changes.
If you are working on a new post, you can quickly edit the generated slug before publishing your post.
Another way of creating custom permalinks on some posts is through the use of Permalink Manager Plugin. This plugin is lightweight and it enables you to change the slug and even the permalink structure.
To show you how this plugin works, let’s assume that your site’s permalink structure is the Custom WordPress permalink structure. And the year, month, day, and author tags are added to the post name tag.
To edit permalink on a post,select a previously published post.
Click on the Permalink Manager button under the title of the post. A textbox showing the post’s url will be displayed.
Edit the url as you wish. In this case, we removed the year, month, date, and author tags. We kept only the relevant keywords.
Click Update to save these changes.
And that’s it, the permalink for this post has been customized.
What is 301 Redirect?
When you change WordPress permalink of a page or post, search engines and other websites linking to that page will no longer be able to find it. This will lead to a drop in traffic.
To fix this, you need to setup 301 redirects. Redirects essentially redirect people who try to access your old url to the new url.
You can setup redirection using plugins and Redirection is one great, free plugin for this purpose.
Redirection plugin permits you to line up redirects. It also helps you find 404 errors, and redirect these on your WordPress site.
First, install and activate this plugin.
Next, go to Tools>>Redirection>>Start setup
Basic setup page will appear on the screen. Check all the applicable options and Continue setup.
At this point, the plugin checks the site for at least one working REST API. If there is, it will indicate Good.
Next, Finish Setup.
After setup completes, click on Finished.
Redirection is now active on your site.
To create actual permanent redirects, click Add New.
- Enter into the “Source URL” textbox the site’s url you want to redirect from.
- Type in the target url you want to redirect to.
- Click Add Redirect.
Unless you require some other format, we recommend the post name permalink structure.
If you were using the default WordPress permalink structure and you decide to change, please ensure you take care of redirects.
If you are creating a new site, you should not have to worry about redirects, simply set the WordPress permalink structure you prefer and you should be good to go.