Duplicate slugs in WordPress permalinks

By default, it is not possible to use the same slug in WordPress permalinks. If you try to use the slug more than once, WordPress will append numeric indexes to the end of permalink. It is really frustrating especially if you would like to use the same title for multiple subcategories or child pages assigned to different parents.

Generally speaking, the permalink system included in WordPress core is pretty limited. It does not provide any user-friendly solution to manage the URL addresses. This could be a real problem if you need a tailored permalink structure or simply want to change URLs individually.

As Permalink Manager stores the permalinks independently, you can change each of posts or terms URL addresses any way you like. It does not matter if your new permalinks contain the native slugs or not.

What is a WordPress slug?

The primary use of the slugs is to identify what post, page, category or term should be loaded. That is exactly why the slugs are present in the original WordPress permalinks.

The native slugs are used also in the custom permalinks generated with Permalink Manager. To use the actual post/terms titles instead of the slugs please change “Slugs mode” in the plugin settings .

The slug is assigned to the post or term after it is published and it is based on the initial post/term title. By default, the slugs will not be automatically updated after you decide to change the title again.

Contrary to original WordPress permalinks system, Permalink Manager can also auto-update the URL whenever the title is changed.

Why the native WordPress slugs needs to be unique?

To keep things simple, if the slugs had not been unique, WordPress could not have indicated what content element needs to be loaded. Technically, you cannot use the same slug for more than one post or term. It means that WordPress will automatically append the numeric index (eg. “-2”) to the end of slug, if you have previously used it for another post or term.

Post title Post slug The original permalink
Hello World hello-world http://example.com/2019/11/20/hello-world
Hello World
hello-world-2 http://example.com/2020/11/15/hello-world-2
Term title Term slug The original permalink
T-shirts t-shirts http://example.com/shop/men/t-shirts
t-shirts-2 http://example.com/shop/women/t-shirts-2

As you can see above, WordPress appended “-2” to the slugs of posts/terms with duplicated title. It does not matter if the rest of permalink is different and URL is unique as a whole. You can add as many homonymous (posts/pages/term with the same title) title, but the native slug will always be unique.

Let’s say we have three posts that have exactly the same title “Hello World“. The native slug will be respectively:

  • hello-world for first post
  • hello-world-2 for second post
  • hello-world-3 for third post
Duplicated post: The second post has the same title, but different native slug (hello-world-2).

Unfortunately, WordPress itself does not allow to use the same slug in another post/term native permalink. However, Permalink Manager overwrites the original permalinks with custom ones. Therefore, you can edit the custom permalinks manually and remove the obsolete numeric appendix (“-2”) from them.

There are two basic ways to remove the numerals appended (eg. “duplicate-slug-2) to the permalinks:

  1. You can manually remove the numerals appended to the slug in individual permalinks.
  2. You can make Permalink Manager use the actual titles instead of native slug in the custom permalinks.

How to adjust the slugs manually?

The easiest method to reuse the same slug is to use “Current URI” field in URI Editor:

Duplicated post: You can make the custom permalink completely different. It means that, you can reuse the original slug (hello-world) even if the native slug is different (hello-world-2).
Sample permalinks with slug duplicates
You can also duplicate the slugs in Bulk URI Editor.

How to use actual titles instead of native slugs?

The manual adjustments of individual custom permalinks could be time-consuming. The alternative solution to allow slug duplicates is to enable “Use actual titles as slugs (Force custom slugs)” mode in the plugin settings. When enabled, Permalink Manager will always use the actual title (eg. “Shoes“) instead of the native slug (eg. “shoes-2“) in the custom permalink.

Please check “Slugs mode” article to find more information on this functionality.

Permalink Manager can detect permalinks with duplicated slugs because it uses a custom algorithm to detect the URLs. Shortly, it checks the full URL address instead of the native slug (part of URL). Hence, the slugs can be reused, but still you need to make sure that the full URL address is unique.

If your new custom permalink is not unique, you will see a duplicate alert displayed below the input field:

Concurrently, you can always check if any of custom permalinks is duplicated in “Permalink Duplicates” section. To display it, please go to “Tools -> Permalink Manager -> Tools -> Permalink Duplicates” admin page.

Make sure that the permalinks are not duplicated

Go up