Skip Navigation

[Gelöst] Removing CPT slug makes child pages not work

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.


The issue here is that the user has an inbuilt hierarchical post relationship and wanted to remove the parent slug from the posts.


This was resolved by using the following .

This support ticket is created vor 4 Jahre, 7 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 Antworten, has 2 Stimmen.

Last updated by Bob Dowdy vor 4 Jahre, 6 Monate.

Assigned support staff: Shane.



I know this is probably outside the realm of your support, but I'm really hoping you can help me.

Using the PHP code I found here (hidden link) I have removed the slug for my CPT called "office". So now /office/name-of-office/ becomes /name-of-office/

The issue I am running into is I can't get the child pages of /name-of-office/ to load (404 or WordPress redirects it to some similarly named page). I have tried every snippet of PHP that you all have linked to in previous support forums, as well as everything I can find on stack overflow.

This site I'm working on has both listings and sold items nested as child pages under each office, so /name-of-office/listings and /name-of-office/listings/sold/

Thanks in advance,



Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bob,

Thank you for contacting our support forum.

Actually I would recommend seeking help from our registered contractors with this as I know that child posts usually require the parent in the url.

These child posts are of the same post type correct and not a different CPT?

Please let me know.


Yes, these are the same CPT.

I am not Bob actually, I'm a developer working on his project. Do you have an estimate for how much that would cost?

There are several freely provided solutions for this online, but none work.



Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)


I believe you are getting this issue because the child post permalink is saved with the parent post in it.

Take a look here .
hidden link

This archive might assist with getting the parent name removed from the permalink to allow it to start working again.

Please let me know if this helps.


Thanks Shane,

That plugin pointed me in the right direction, and I found the perfect plugin to fit my needs. It allows for permastructures that kick in automatically when a specific CT is saved/updated:

My issue is resolved.



My issue is resolved now. Thank you!