Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Create Custom Permalinks in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Create Custom Permalinks in WordPress

Do you want to create custom permalinks in WordPress for posts, pages, and other post types? Recently one of our readers asked if it was possible to create custom permalinks in WordPress. Permalinks aka your page URL structure plays an important role in SEO. In this article, we will show you how to create custom permalinks in WordPress without affecting your SEO.

Custom Permalinks in WordPress

What is a Custom Permalink?

WordPress comes with a handy option to create SEO friendly URL structure called Permalinks for your site. All you have to do is go to Settings » Permalinks page and choose a URL structure.

The permalinks settings page in WordPress

There are a number of options to choose from, and you can even specify a custom structure. Take a look at our SEO Friendly URL Structure for WordPress article to learn how to use permalinks in WordPress.

Choosing a permalink structure affects all posts and pages (both new and old) on your WordPress site, so you have to be careful when changing this.

But what if you want to use a different URL for only some posts on your site? What if you want to have a custom permalink for your custom post types? Maybe you want to have a custom permalink for your categories and tags? That’s when you need a custom permalink.

Custom permalink is basically a URL structure applied to that particular item in WordPress without affecting the rest of your URL structure.

Let’s take a look at how you can create custom permalinks in WordPress.

Creating Custom Permalinks in WordPress

There are two ways to creating a custom permalink in WordPress. Often when users are talking about changing the permalink of a WordPress post, they are really talking about the post slug. We will show you how to change the post slug.

But in some cases, users may want to create a completely custom URL structure, and we will also show you how you can do that in WordPress.

Method 1. Changing The Slug Part of a Permalink

In WordPress, the term slug is used for the url friendly name of a post, page, tag, or category. It is automatically generated by WordPress and used in URL when you create a new item.

For example, a post titled “20 Most Amazing Coffee Shops in Manhattan”, WordPress would generate a post slug like this 20-most-amazing-coffee-shops-in-manhattan. Depending on what permalink structure you have, your post URL will look something like this:

http://example.com/2016/02/20-most-amazing-coffee-shops-in-manhattan/

Same thing happens for your pages, custom post types, tags, categories, custom taxonomies, etc.

Now if you just want to change that slug part of the permalink, then that’s easy. You can do that without installing any plugins or writing any code.

Changing Slug of a Post or Page

The easiest way to change the slug part of a URL for a WordPress post and page, or custom post types is by editing them.

On the post edit screen, look just below the post title and you will see the post URL with an edit button next to it.

Changing post slug in WordPress

Clicking on this edit button will allow you to change the post slug. You can use alpha-numeric characters and dashes in your post slug.

For a more SEO friendly URL, make sure you choose a post slug that contains keywords people would use to search for that content.

Changing Slug of Categories and Tags

Changing the slug of categories and tags is also very easy. Simply go to Posts » Categories and WordPress will show you the list of categories.

Edit categories in WordPress

You can take your mouse over to a category and click on the quick edit link. WordPress will show you the title of the category, and its URL slug. You can change the URL slug and click on the Update button to save your changes.

Changing category slug using quick edit

Same method applies for tags and custom taxonomies as well.

Creating Completely Custom Permalinks

Changing post slug does not change your actual permalink structure. What if you wanted to change permalink for single post, post, page or taxonomy?

For example, if your post URL is like this:

http://example.com/2016/02/20-most-amazing-coffee-shops-in-manhattan/

And you want to change it to something like this:

http://example.com/best-lists/coffee-shops/top-coffee-shops-in-manhattan/

Let’s take a look at another example. Your category URL in WordPress is like this:

http://example.com/category/travel

For that particular category, you want to change it to something like:

http://example.com/travel/

Normally this would require you to change your permalink structure, but that would affect all URLs on your site.

Here is how you would create a custom permalink safely without affecting any other URLs on your site.

First thing you need to do is install and activate the Custom Permalinks plugin.

Upon activation, you can simply edit a post or page and change its URL to anything you want.

Custom permalink for a single post

You can also edit categories and tags. Simply go to Posts » Categories and click on the edit link below the category you want to change.

On the edit category page, scroll down to the bottom and you will see the custom permalink field.

Custom Permalink for a single category in WordPress

You can do the same for tags and custom taxonomies as well.

Setting up Redirects for Custom Permalinks in WordPress

When you are adding a custom permalink for a new post, then you don’t have to worry about redirects.

On the other hand, if you are changing the URL of an already published post, then you need to setup proper redirects.

Users coming to the old address from search engines and other websites, will not be able to find that page unless you setup redirects.

Same goes for your categories and tags. If a category/tag archive page was indexed, then it would become unavailable when you change the URL.

You will need to redirect users and search engines to the new address. Take a look at our beginner’s guide to creating redirects in WordPress.

We hope this article helped you create custom permalink in WordPress. You may also want to see our list of 9 best WordPress SEO plugins and tools that you should use.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.


Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Jean-Francois Mayer says:

    Thank you. This is indeed a good description. However, there is one aspect that you do not mention: what happens to the customized slugs in case the permalink structure changes.

    I am currently moving a website in French to WP. When titles are too long, or include apostrophes (that result into making two words into one, when slugs get automatically created), I have shortened them.

    After a number of my customized permalinks had been created, I decided that I preferred the permalinks to follow a structure on the pattern year-month-day, i.e…./2016/08/15/… instead of …/2016/08/…

    Easily done… but all my customizations were gone!

    I will recreate them. But then, how to make sure that my customized permalinks will stick, even if I would decide to change again the permalink structure before the site goes live?

    There should be a way, or a plugin – but I have not yet found it.

    • WPBeginner Support says:

      Slugs are not supposed to be changed when you update permalink structure. They are stored in the database and will be used again when you use a Permalink structure that uses post-name in the URL instead of ID.

      • Jean-Francois Mayer says:

        Thank you very much for your reply.

        Yes, I expected indeed custom slugs not to change when I updated the permalink structure… but they did, for reasons beyond my understanding, and I do not dare to test that a second time. It may have to do with the fact that a number of posts were imported from another CMS in an automated way, which resulted in numeric slugs, that we managed to regenerate (using Permalink Manager) in order to bring them to standard slugs. Maybe this had unexpected consequences when changes in settings were made at a later stage.

        Anyway, good to know this is not a frequent behavior, and probably caused by something else. But I will be extremely careful in the future with any change in the permalink structure!

  2. Logen says:

    The recent low ratings, inactive support forums and lack of response from author is making me hesitant to use Custom Permalinks. Anyone has any issues with it, considering last plugin update was 7 months ago?

  3. mansuri says:

    superb post sir

  4. Aseel says:

    Great articel
    Thanks :)

  5. Stefano says:

    Really interesting. Many thanks for the good stuff. I’ll give a try for sure as I have to manage categories, sub-categories and a lot of tags.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.