Custom Post Types Permalinks

In WordPress, you can use custom post types to extend the standard posts and pages. They can help you organize and manage content, whether it is a business website, store, documentation site, directory, or any other type of website.

The strength of WordPress is its flexibility, but default permalink settings cover only basic options. Each post type in WordPress has a predefined permalink structure, typically using the post type slug followed by the title.

You may want to change it when the default URLs do not clearly describe the content of your pages. Using Permalink Manager, you can configure custom permalinks easily from the dashboard and automatically redirects old URLs to the new ones.

Original URLs

What are Custom Post Types?

Most WordPress sites work with two main content types: pages and posts. When your content does not fit into them, you can create custom content types to keep it separate. Custom types can have their own fields, layouts, and rules, so you can treat them differently from standard posts.

They are extremely versatile and form the backbone of hundreds of plugins. WooCommerce, for example, uses custom types to manage products, while others handle events, courses, portfolios, testimonials, or job listings.

Do You 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".

The with_front Parameter in register_post_type()

When you register a custom post type, the rewrite argument can include a parameter named "with_front". This controls whether the global permalink settings (defined in "Settings -> Permalinks") are applied to the custom post type URLs.

By default, WordPress may add a front base such as /blog/ to all post URLs. Setting 'with_front' => true means the custom post type slug will include this prefix.

function register_publication_cpt() {
	 $args = array(
		 ...
		 'rewrite' => array( 'with_front' => true ),
		 ...
	 );
	 register_post_type('publication', $args);
}
add_action('init', 'register_publication_cpt');

For example, if your site uses a permalink structure that includes /blog/ and your custom post type has the slug publication , the URL for their items would be:

https://example.com/blog/publication/sample-post

If you do not set 'with_front' parameter, or set it to false, the /blog/ prefix is not applied. The URL will then be:

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

Custom Post Types Permalinks

The rewrite slug is an optional parameter when registering post types. It sets the default URL pattern for the custom post type items and gives some control over their format.

It is often ignored, but understanding it helps avoid conflicts in rewrite rules that could prevent WordPress from processing URLs as expected.

The rewrite slug is specified as the 'slug' parameter under 'rewrite'. In the example above, it is set to 'publication'. Therefore, the custom post type's permalink structure will be as follows:

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

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.

Extra Customization Options

The built-in permalinks in WordPress are limited to basic structures. Using a plugin or a extra code snippet, you can remove default rewrite bases, add category names, or standardize URLs across post types.

For a detailed guide on how to set up and use custom permalinks to organize your site’s URLs, see our full article about custom permalinks.

FAQ

What Happens to Old URLs After I Change a Custom Post Type Permalink?

If a permalink changes, the previous URL will no longer work unless a redirect is set up. Using a plugin like Permalink Manager ensures that old URLs automatically redirect to the new structure, preventing broken links and loss of traffic.

Can I Change the Permalink Structure for a Custom Post Type?

Yes. Changing the URL format for a custom post type requires either editing the code that registers the post type or using a dedicated plugin such as Permalink Manager. The built-in WordPress settings do not allow to do this directly from the admin dashboard.

How Are Permalinks Generated for Custom Post Types?

By default, WordPress generates a permalink using the post type slug followed by the post title. This structure applies to all items of that post type unless you modify it using custom code or a plugin.

Last updated by Maciej Bis on: January 5, 2026.


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 *