Skip Navigation

[Resolved] Rewriting taxonomy slug as / breaks site

This support ticket is created 6 years, 3 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by liatG 6 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1107798
Class Part taxonomy terms.png
current taxonomy slug.png
tried rewriting taxonomy slug.png

I am trying to: rewrite a taxonomy slug so that the main term does not appear in the URL.

For archive pages of my "class-part" taxonomy, I don't want the words "class-part" to appear in the URL. I just want the child terms to appear.

So instead of hidden link, I want to see hidden link

I know I can rewrite individual page URLs with a URL manipulation plugin but I wanted to do this on the level of the whole taxonomy.

This is what I did: I put a / in the "rewrite - Replace taxonomy slug with this" field.

The page did work correctly (the page that before the change was showing at hidden link did successfully display at hidden link) BUT almost all the other pages on my site broke - led to error messages saying "this link is faulty, the page doesn't exist."

This is for example on completely unrelated pages, like hidden link.

Because of this, I had to revert the change that I made, so you won't be able to "see" the problem on my site right now, because I can't have a bunch of broken links.

But maybe you can tell me what I'm doing wrong or maybe if this is something that can't be done.

If this can't be done, the only other way I can think to accomplish the same thing is to maybe change the slug of the class-part taxonomy itself to be "my-classes" and the name to My Classes and remove the highest term in the taxonomy (which right now is "My Classes). But Christian and I have already set up a bunch of code having to do with the levels of these terms and I'm worried that if I make that change it will mess all that up.

So I guess my question is also to Christian - If I do the above fix, would that seriously mess up the code you set up for me for my sidebar navigation and archive post navigation? Would love your advice.

Thanks for your help on this,
Liat

#1108554

I wanted to edit my question to remove the last paragraphs - the idea I had of changing the taxonomy slug itself and all that. I think that is a bad idea because it will mess up lots of the navigation and the breadcrumbs too - I like having "my classes" in the breadcrumbs.

So please disregard the last paragraphs (the ones starting with "If this can't be done, the only other way I can think...")

Thank you!

#1109012

Hi Liat, for the taxonomy slug rewrite, it's recommended to use a unique slug so WordPress's permalinks system is able to parse those links intelligently. I'm not aware of a way to remove the entire taxonomy slug from the URL with Toolset, so I believe that would require some custom rewrite rules or a third-party plugin.

#1109014

Thank you Christian!