How to create posts or pages with the names in wordpress?
-
22-10-2019 - |
Question
When you develop a site on wordpress you may want to create posts/pages with the same name, something that wordpress does not allow by default.
Use cases:
example.com/en/contact
example.com/fr/contact
example.com/en/support/contact
I am currently using WPML plugin in order to create multilanguage sites and I encountered this limitation in wordpress.
How can I solve this problem? Do you know any tricks or plugins that would allow me to deal with this problem.
Solution
When you develop a site on wordpress you may want to create posts/pages with the same name, something that wordpress does not allow by default.
This is statement is not true. WordPress will allow you to set up pages with the "directory" structure that you specified right out of the box. I was just able to do this on my test installation. I created a page with slug "en" and then created a child page named "taco". Next I created a page named "fr" and added a child to this page named "taco". Both taco pages have the slug of "taco". There may be an issue with the plugin that you are using. Have you tried this without the plugin installed?