Archived topic
Remove parent slug in URL
5 replies · Started by Nadia on October 4, 2016
Hi
I am trying to reduce the overall lenghth of the URLs whilst using parent/child page structure.
I could not find any code to do this. Do you have any advice for a tested solution, without a plugin?
Thanks
Nadia
Hi Nadia,
You can just not set a page as a child of another page.
If the reason you're doing that is to create a dropdown menu, you can create them in "Appearance > Menus" without the parent/child relationship: https://generatepress.com/knowledgebase/using-menus/
Hi Tom
No the reason I am doing this is because I use the plugin Dyanic Widget. It is much easier to set up widgets when there is a parent/child relationship. I can just set it up so that it shows on every page that has a certain parent and just forget about it. Otherwise I need to go page by page.
Is there no way at all? I am sure there is a way to do this to remove the catergory from the permalink as I have used this in the past. But never tried for the parent/child pages.
Thanks again
Nadia
After a quick search, this plugin might offer a solution: https://wordpress.org/plugins/custom-permalinks/
If you Google "wordpress remove parent page from slug url", you'll find a lot of functions which might be worth trying as well.
Hi Tom
Yes I have tried those functions (some anyway) but they did not work. I was wondering if there was something with GeneratePress.
But thanks for looking it up for me!
Nadia
No problem, I hope you find a good solution :)