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.
author_post_slug
and give it the same value (e.g. post_slug
), and filter the URL requests viaparse_request
, or create custom rewrite rules for those URLs.