WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
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

WPBeginner» Blog» Plugins» How to Change Custom Post Type Permalinks in WordPress

How to Change Custom Post Type Permalinks in WordPress

Last updated on November 28th, 2016 by Editorial Staff
98 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Change Custom Post Type Permalinks in WordPress

Recently, one of our readers asked if it was possible to change the custom post type permalink structure in WordPress. By default, you can change the permalink structure of WordPress posts, but not custom post types. In this article, we will show you how to change custom post type permalinks in WordPress.

How to change custom post type permalinks in WordPress

Why Change Custom Post Type Permalinks in WordPress?

WordPress uses 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 Settings » Permalinks page. However, you will notice that you can only change permalink structure for blog posts.

Permalink settings page in WordPress

If you are using custom post types or custom taxonomies on your website, then WordPress will use default permalink structure for those.

For example, if you have a custom post type called ‘Movies’, then its URL structure will look like this:

http://example.com/movies/the-force-awakens/

If your custom post type has archives enabled, then the archive page URL will look like this:

http://example.com/movies/

This URL scheme is quite SEO friendly and in most cases you don’t need to change it. However, sometimes you may want to customize it to meet your own needs.

Having said that, let’s see how you can easily customize custom post type permalink structure in WordPress.

Changing Custom Post Type Permalinks in WordPress

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 Settings » Permalinks page and scroll down to ‘Permalink Settings for Custom Post Types’ section.

Custom post types permalinks

Here you can change the permalink structure of single items in your custom post type.

You can use all the standard WordPress permalink tags. For a complete list of available tags, see our article on using SEO friendly URL structure in WordPress.

Let’s assume that you want to use post ID instead of 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, and without them your permalinks will not work.

Adding tags to customize custom post type permalinks

Don’t forget to click on the save changes button to store your settings.

Now the permalinks for a single item in your custom post type will look like this:

http://example.com/movies/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 you want to add /year/ before the post name in URL. In that case, you will use these tags:

/%year%/%post_name%/

Click on the save changes button to update your permalinks.

Now the single item permalink for your custom post type will look like this:

http://example.com/movies/2016/the-force-awakens/

So far so good. Now let’s try another example.

Let’s assume that you are using a custom taxonomy called ‘genre’ with your custom post type ‘movies’ and you want to add the custom taxonomy term into the URL. In that case, you will use these tags:

/%genre%/%post_name%/

In this example, genre is the slug of our custom taxonomy.

Click on the save changes button to update your permalinks.

Now the single item permalink for your custom post type will look like this:

http://example.com/movies/sci-fi/the-force-awakens/

That’s all, we hope this article helped you learn how to easily change custom post type permalinks in WordPress. You may also want to see our list of 12 most useful WordPress custom post types tutorials.

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.

98 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

12 Comments

Leave a Reply
  1. Terry Yung says:
    Dec 31, 2020 at 1:45 am

    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!

    Reply
    • WPBeginner Support says:
      Dec 31, 2020 at 9:53 am

      Glad our article was helpful :)

      Reply
  2. Scott says:
    Dec 6, 2020 at 5:52 pm

    Pulling my hair out trying to figure out why I couldn’t do this with the default WP settings. Thank you!

    Reply
    • WPBeginner Support says:
      Dec 7, 2020 at 11:55 am

      Glad our guide could help :)

      Reply
  3. Morgan says:
    Jun 6, 2020 at 12:20 pm

    Hi,

    How do you remove the date from a URL and still keep all the link juice?

    Reply
    • WPBeginner Support says:
      Jun 8, 2020 at 3:45 pm

      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/

      Reply
  4. Elliott says:
    Oct 29, 2019 at 12:50 pm

    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/

    Reply
    • WPBeginner Support says:
      Oct 30, 2019 at 9:42 am

      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.

      Reply
  5. Pardeep Singh says:
    Dec 10, 2018 at 9:36 am

    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.

    Reply
  6. md.ismail hossain says:
    Dec 3, 2016 at 2:54 am

    this post is very helpful to learn about custom post…………thanks for posting….

    Reply
  7. Mike Patterson says:
    Nov 29, 2016 at 6:12 am

    For SEO, this is very important. It’s more like having a keyword in the web link itself. Nice post

    Reply
  8. rezky says:
    Nov 28, 2016 at 1:30 pm

    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

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WP Mail SMTP logo
WP Mail SMTP
Fix WordPress email delivery issues. #1 SMTP plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
Weglot Coupon
Get 15% OFF on Weglot multilingual plugin for WordPress.
PanKogut
PanKogut Coupon
Get 20% OFF on PanKogut's premium WordPress themes collection.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.