Custom Post Types Permalinks

Custom post types and taxonomies make managing content easier, but their built-in permalinks are very limited. WordPress natively cannot let you fully customize them because rewrite rules only support basic URL structures.

Out of the box, WordPress only allows editing the rewrite base per post type or the slug for a CPT item. So if you need a tailored solution, the most convenient option is to install additional plugin.

This guide explains why the standard rewrite rules and slugs are restrictive and explains exactly why and how to implement a dedicated custom permalink solution for complete, flexible control over your CPT URLs.

Original URLs

What are Custom Post Types?

In WordPress, you usually work with two main content types - pages and posts. These come built into the system. Sometimes, your content may not fit well into either one. If this is the case, you may declare a custom content types and separate the content from the standard posts and pages.

There are many situations when this may be useful. Custom post types may handle a variety of content types, including testimonials and events. They are also an essential component of the WooCommerce plugin, which uses them for products.

Do I Really Need a Custom Post Type?

While there are many situations where unique post types can be advantageous, they are not necessarily essential. Consider a few things before using them.

  1. Blogs
    First and foremost, for traditional blog websites, the built-in "post" type is more than enough. Categories and tags are sufficient for most blogging needs.
  2. Simple websites
    For websites with just a few static pages like "About Us" and "Contact", there is no point in using extra custom post types.
  3. Content that is alike in structure and form
    When you have a lot of similar content items, like "apartments for rent", CPTs make it easier to organize and manage them. A notable example of this is the "products" post type used in WooCommerce for online stores.

Declaring Custom Post Types

There are many methods to define a custom post type. If you do not know much about coding or simply prefer not to deal with code, using a plugin is a the simplest way. There are lots of freely available plugins, like ACF or Pods, which allow you to register new Custom Post Types (CPTs) and define extra custom fields for them.

The other popular way is to add a code snippet to your website and using the register_post_type() function.

function custom_post_type_registration() {
	 $args = array(
		 'public' => true,
		 'label' => 'Book',
		 'supports' => array('title', 'editor', 'thumbnail'),
		 'rewrite' => array('slug' => 'publication'),
	 );
	 register_post_type('book', $args);
}
add_action('init', 'custom_post_type_registration');
In the example above, the 'slug' argument is included, but you do not have to add it. If you do not set the 'rewrite' arguments at all, WordPress will automatically use the custom post type’s default slug, which in this example is "book".

When registering post types, one of the parameters you can pass is the rewrite slug. Using this, you can overwrite the default URL structure of your custom post type and change their URLs format.

When setting up the custom post types, users often overlook it. Understanding this is critical in order to avoid rewrite rules conflicts that might prevent WordPress from processing URLs correctly.

To make things clear, let us go back to the basic code from the previous section. The rewrite slug is specified as the 'slug' parameter under 'rewrite'. In that particular instance, it is set to 'publication'.

Therefore, the custom post type's permalink structure will be as follows:

https://example.com/publication/post-title

On smaller sites, this setup is often all you need. But if your site uses several custom post types or taxonomies, your URLs can become confusing, making it harder to understand what the page is actually about.

Rewrite slug as a URL base
By default, you can only use the slug (anna-nowak), which is the last part of the URL. Rewrite slug "/team/" in the example above cannot be easily customized.

Custom Post Type Permalinks

What are Rewrite Rules in WordPress?

The rewrite rules are the core logic behind your permalinks and their purpose is to tell WordPress on how to correctly assign a URL to a specific content item. WordPress uses them to and reduce the number of database requests when figuring out what page to show a visitor.

If your permalink matches one of these defined rules, WordPress can instantly turn that URL pattern into the correct database query, efficiently loading the appropriate template file and delivering the exact page the visitor wants.

Rewrite rules mechanism

To better understand how rewrite rules work, let’s use a simple analogy. Imagine you are looking for a friend's house, and all he gave is his address. The street name immediately leads you to the neighborhood, and the house number points the exact building. Just like this address system, rewrite rules direct visitors to the correct page.

Likewise, WordPress processes a URL by first checking it against the rewrite rules, which is like identifying the street name. Then it queries the database to pull the exact content item, which is like locating the house.

By default, WordPress dynamically generates permalinks using rewrite rules. Each of content types needs unique permalink structure with different base, which can be limiting if you want more control over URLs.

You can work around this limitation by using permalink plugins. These plugins let you create URL structures that the built-in system cannot handle on its own.

With custom permalinks, you can change every part of a URL instead of being limited to the slug. This makes it easier to design URLs that are more readable. You can match your URLs to your site’s structure, include category names, or add other useful details that explain what the page is about.

Default permalink system is sufficient for most WordPress projects, but some require more flexibility. Custom permalinks become useful when you want to duplicate the same URL format for multiple custom post types or remove the rewrite slug that WordPress adds automatically.

To implement them, you can write a tailored code snippet. The other option, for those who prefer a more convenient solution is a plugin like Permalink Manager that offers a comprehensive, no-code solution for reliable permalink customization.

Last updated by Maciej Bis on: November 1, 2025.


Maciej BisFounder of Permalink Manager & WordPress Developer

The developer behind Permalink Manager, a plugin for managing permalinks, has been working with WordPress, creating custom plugins and themes, for more than a decade.

Leave a Reply

Your email address will not be published. Required fields are marked *