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.
There are two basic ways to remove the numerals appended (eg. “duplicate-slug-2“) to the permalinks:
- You can manually remove the numerals appended to the slug in individual permalinks.
- You can make Permalink Manager use in custom permalinks the actual title (without numerals appended to the slug) instead of native slug.
How to manually adjust the custom permalinks and reuse the slugs?
By default, the native slug is based on the post/page/term title. 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
As you can see, the numeral is appended to the end of native slug (hello-world-2). It is because the native slug (hello-world) was already assigned to the first post. To keep them unique, WordPress added “-2” to the new post’s slug.
With Permalink Manager you can remove the appendix and completely customize the full permalinks. The easiest way to reuse the same slug and remove the numerals from the slugs is to use URI Editor.
It works because Permalink Manager 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.
Custom permalink duplicates
You can use the same slug in custom permalinks as long as URL is unique as a whole. Otherwise, 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.
How to always use actual title instead of native slug in new permalinks?
The manual adjustments of custom permalinks could be time-consuming. The alternative and more comfortable solution is to enable “Use actual titles as slugs (Force custom slugs)” mode in Permalink Manager settings.
When enabled, Permalink Manager will always use the actual title (“Shoes“) instead of the native slug (“shoes-2“) in the custom permalink.
Below you can see another example. Two categories have the same title, unique slugs (highlighted with red) and custom permalinks (highlighted with green).
Apply the new settings to the old WordPress permalinks