How to Duplicate Permalink Formats in WordPress?

Every post type and taxonomy in WordPress needs to have its own permalink format. This is done to prevent conflicts between different types of content, but it also often makes URLs feel inconsistent.

Many website owners prefer a more structured approach where similar content follows the same URL pattern. This makes navigation quicker and helps visitors understand how different parts of the website are connected.

The problem is that WordPress natively does not allow to apply the same base URL to multiple content types. While there are workarounds, they often involve custom coding, which can be difficult and may lead to unexpected conflicts with other features or plugins.

Duplicate rewrite base in WordPress permalinks

Imagine you want all content related to your car listings under /cars/, with single items at /cars/%manufacturer%/%cars%/ and custom taxonomies at /cars/%manufacturer%/.

By default, WordPress will not allow this setup because each content type must have a unique base. Instead, you would be forced to use separate structures like /cars/ and /manufacturers/, breaking the desired hierarchy.

Initial Permalinks (Before Customization):

Car (custom post type):
http://example.com/cars/fiesta-2015

Manufacturer (custom taxonomy):
http://example.com/manufacturer/ford

Transmission (custom taxonomy):
http://example.com/transmission/automatic

With Permalink Manager, you can easily set up your URLs so that all content types share the same base, like /cars/, without having to use complicated rewrite rules.

This is possible because the plugin identifies posts and terms based on their full custom permalinks, not just their slugs. As long as you make sure each individual permalink is unique, the plugin will handle it without any issues.

Custom Permalinks (After Using Permalink Manager):

Car (custom post type):
http://example.com/cars/ford/fiesta-2015

Manufacturer (custom taxonomy):
http://example.com/cars/ford

Transmission (custom taxonomy):
http://example.com/cars/automatic

Step-by-Step Guide

The process of duplicating the permalink base is not complicated and the first thing you need to do is adjust the permastructure settings.

To do so, go to the admin section "Tools -> Permalink Manager -> Permastructures". Once you have opened it, find all of the content types whose permalink base you want to alter.

Old permalink formats in Permastructure settings

This should be straightforward. All you have to do is replace the words "transmission" and "manufacturer" with the word "cars".

Original permastructure settings:

Car (custom post type):
http://example.com/cars/%car%

Manufacturer (custom taxonomy):
http://example.com/manufacturer/%manufacturer%

Transmission (custom taxonomy):
http://example.com/transmission/%transmission%

New permastructure settings:

Car (custom post type):
http://example.com/cars/%car%

Manufacturer (custom taxonomy):
http://example.com/cars/%manufacturer%

Transmission (custom taxonomy):
http://example.com/cars/%transmission%

New permalink formats

Please remember to save your changes after adjusting the settings by clicking the "Save Permastructures" button at the bottom. Now, when you add a new "car" item, "transmission" or "manufacturer" term in the future, Permalink Manager will adhere to the format you set.

To avoid URL changes that could harm SEO, existing custom permalinks are not automatically updated when permastructures are changed. You can use the "Regenerate/reset" tool to apply the new URL formats to existing content.

Understanding how WordPress handles permalinks and rewrite rules can be tricky at first. Essentially, WordPress adds predefined slugs to different types of content, allowing it to recognize and efficiently process their URLs. This helps to reduce unnecessary database queries, making your website load faster.

However, if custom post types and taxonomies share the same permalink base, WordPress may struggle to determine the correct content. This can lead to errors where pages fail to load, displaying a "not found" message instead.

One issue that emerges here is that certain rewrite rules (permalink formats) take precedence over others. Furthermore, when WordPress reads the URL, it does not care whether the post, page, or term exists; it simply has to match the permalink format with possibly the greatest priority.

"Product category" permalinks (WordPress detects them correctly)

http://example.com/shop/clothing
http://example.com/shop/clothing/men
http://example.com/shop/clothing/women

"Product" permalinks (WordPress sees them as product categories and returns 404)

http://example.com/shop/amazing-plain-t-shirt
http://example.com/shop/beautiful-white-cotton-dress

Take a look at the example above. If you use the same rewrite slug (shop) for both products and product categories permalinks, WordPress will treat any URLs starting with "/shop/" as product category permalinks.

As a result, whenever a visitor accesses any product page, WordPress will attempt to load a product-category page that does not exist.

Last updated by Maciej Bis on: February 14, 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.

Go up