1. Home
  2. Docs
  3. Tutorials
  4. Duplicate slugs in WordPress permalinks

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.

You can easily get around this problem and keep the duplicated slugs in the custom permalinks controlled by Permalink Manager.

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
Post #2. The second post has the same title, but different native slug (hello-world-2).

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.

Post #2: 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).

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.

Make sure that the permalinks are not duplicated

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.

There are two categories added with the same title (“Shoes”). That is why the native slug for this term is set to “shoes-2”.

Below you can see another example. Two categories have the same title, unique slugs (highlighted with red) and custom permalinks (highlighted with green).

Sample permalinks with slug duplicates

Permalink Manager will automatically use the actual titles only in new posts’ & terms’ permalinks. To apply new URL structure to the existing content elements you will need to correspondingly regenerate the old permalinks.