By default, you can change the permalink structure of WordPress posts, but not custom post types. However, with the right plugin, you can easily create permalinks for custom posts.
Over the years, we’ve helped thousands of WordPress users optimize their sites for search engines and correctly set the permalink settings. After testing multiple plugins, the easiest way to change custom post permalinks is by using the Custom Post Type Permalinks plugin.
In this article, we will show you how to change custom post type permalinks in WordPress.
Why Change Custom Post Type Permalinks in WordPress?
WordPress uses an SEO-friendly URL structure, which makes your WordPress URLs readable and search engine friendly. These SEO-friendly URLs are called permalinks.
You can customize permalinks by visiting the Settings » Permalinks page in your WordPress dashboard. However, you will notice that you can only change the permalink structure for blog posts.
If you are using custom post types or custom taxonomies on your website, then WordPress will use the default permalink structure for those.
For example, if you have a custom post type called Movies, then its URL structure will look like this:
https://example.com/movies/the-force-awakens/
Or if your custom post type has archives enabled, then the archive page URL will look like this:
https://example.com/movies/
This URL scheme is quite SEO-friendly, and in most cases, you don’t need to change it on your WordPress website. However, you may want to customize it to meet your own needs.
Having said that, let’s see how you can easily customize the custom post type permalink structure in WordPress.
Changing Custom Post Type Permalinks in WordPress
The easiest way to edit custom post type permalinks is by using the Custom Post Type Permalinks plugin. It is a free WordPress plugin that adds more WordPress permalink settings options and allows you to customize them for different post types.
Disclaimer: The Custom Post Type Permalinks plugin hasn’t been updated in a while, but we tested it recently, and it’s still working fine. For details, you can see our guide on whether you should use outdated plugins.
The first thing you need to do is install and activate the Custom Post Type Permalinks plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit the Settings » Permalinks page in your WordPress dashboard and scroll down to the ‘Permalink Settings for Custom Post Types’ section.
Here, you can change the permalink structure of specific items in your custom post type.
You can use all the standard WordPress permalink tags. For a complete list of available tags, you can see our article on using an SEO-friendly URL structure in WordPress.
Examples of Custom Post Type Permalinks
Let’s assume that you want to use the post ID instead of the post name in the URL. In that case, all you need to do is add this tag:
/%post_id%/
Notice the trailing slashes at the beginning and end of the tag. These trailing slashes are the separators. Without them, your permalinks will not work.
Don’t forget to click on the ‘Save Changes’ button to store your settings.
Now, the WordPress permalinks for a single item in your custom post type will look like this:
https://example.com/courses/133/
The number in the URL will be the numeric ID of the post in your WordPress database.
Let’s take a look at another example. Let’s say that you want to add /year/ before the post name in the URL. In that case, you will use these tags:
/%year%/%post_name%/
Once you are done, simply click on the ‘Save Changes’ button to update your permalinks.
Now, the single item permalink for your custom post type will look like this:
https://example.com/courses/2023/seo-for-beginners/
Now, let’s assume that you are using a custom taxonomy called ‘digital marketing’ with your custom post type ‘courses’, and you want to add the custom taxonomy term into the URL.
In that case, you will use these tags:
/%digital_marketing%/%post_name%/
In this example, ‘digital marketing’ is the slug of the custom taxonomy. The single item permalink for your custom post type will look like this:
https://example.com/courses/digital-marketing/seo-for-beginners/
We hope this article helped you learn how to easily change custom post type permalinks in WordPress. You may also want to see the most useful tricks tricks for custom post types in WordPress and how to easily reorder posts in WordPress.
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.
Erik
I want to let the name of the post type out of the permalink, is this possible?
Fex example:
mywebsite.com/location/texas
to
mywebsite.com/texas
Is this possible with this plugin? Or can I use something else for this?
Terry Yung
Fantastic article!
I have a custom post type that users may change their post title frequently. With this plugin I don’t have to worry about new titles with old-title-containing permalinks!
WPBeginner Support
Glad our article was helpful
Admin
Scott
Pulling my hair out trying to figure out why I couldn’t do this with the default WP settings. Thank you!
WPBeginner Support
Glad our guide could help
Admin
Morgan
Hi,
How do you remove the date from a URL and still keep all the link juice?
WPBeginner Support
You would want to create a 301 redirect, we have a guide on how to create one below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-creating-redirects-in-wordpress/
Admin
Elliott
What if you want to change the main taxonomy name, like for instance in your article the term “movies”. A theme I am using has a set url for the portfolio items and I want to change it. for example it uses domain.com/motor_project/protfolio-item and I want to change the term /motor_project/
WPBeginner Support
For a custom post type built into your theme, you would first want to reach out to your theme’s support to ensure there is not a specific reason for the permalink being the way it is.
Admin
Pardeep Singh
Hi,
I am using two post types:
a) Posts ( Default post type)
b) Program ( Custom Post Type )
I want to add the string ‘blog’ for default post type post and ‘program’ for custom post type like:
example.com/blog/post-name/
example.com/program/program-name/
If I am trying to add it into the permalink into admin panel then it is also added into the program post type like : example.com/blog/program/program-name/
I am using custom-post-type-ui for custom post and “With Front” property is set to false. But still not working fine.
Thanks in advance.
md.ismail hossain
this post is very helpful to learn about custom post…………thanks for posting….
Mike Patterson
For SEO, this is very important. It’s more like having a keyword in the web link itself. Nice post
rezky
hello, i wanna ask,
how do I get a list of posts custome post type in which will be in place at the end of the article on the type of regular post?
who only took the post whose title is almost as usual on the post?
for example, the usual post
Article title —- —-
Content —– —
—- End of the content —
lamborgini car list
Car lamborgini 5
Car lamborgini 4
Car lamborgini 3
Car lamborgini 2
Car lamborgini 1
and so on until there are no same title