How to allow different authors to use same post slug?

We have a multi-author WordPress site where different authors need the ability to use the same slug (post_name). Right now WordPress will append a -2 to the slug but how can we prevent WordPress from appending dashes and keeping the slug the same? Note that our permalinks will still be unique even if the slug is the same as we use the author’s username in the permalink as illustrated below:

Current Implementation:

example.com/author1/post-slug
example.com/author2/post-slug-2

Desired Implementation:

example.com/author1/post-slug
example.com/author2/post-slug

Please advise on how we can achieve the desired implementation. Thank you.

Read more here:: How to allow different authors to use same post slug?

Leave a Reply

Your email address will not be published. Required fields are marked *