Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom hierarchical taxonomy called "places" set up with categories like so: Services > Financial Services > Financial Advisors.

The permalink for this category listing page is currently mysite.com/places/services/financial-services/financial-advisors.

Does anyone know how I can remove the parents from my permalinks so it would simply become mysite.com/places/financial-advisors/ ?

I've searched quite a lot and cannot find an answer. There's a plugin out there called "no category parents" that achieves this for regular blog posts, but it doesn't work for custom taxonomies.

Any help would be much appreciated!

share|improve this question

2 Answers 2

Simply set to false 'hierarchical'=>true from rewrite parameter in your register_taxonomy. It should looks like this:

register_taxonomy('places', 'post', array(
    // Hierarchical taxonomy
    'hierarchical' => true,
    'labels' => array(
        //here your labels
    ),
    // Control the slugs used for this taxonomy
    'rewrite' => array(
        'slug' => 'places', 
        'with_front' => false, // Don't display the category base before "/places/"
        'hierarchical' => false // This will avoid terms concatenation!
    )
));
share|improve this answer

Check this plugin Taxonomic SEO Permalink.

Also check this stackexchange question. Remove taxonomy slug from a custom hierarchical taxonomy permalink

Hope this will solve your problem. Cheers!!!

share|improve this answer
    
Thanks, but I've tried Taxonomic SEO Permalink and it doesn't seem to do what I want. I also looked through that other question posted but I think they are talking about simply removing the CPT name from the URL? At any rate, I tried all of the options in the thread and was unable to remove any parents from the permalink. –  JWP May 13 '12 at 12:52
    
Well, this answer is off topic - it won't solve this problem, I guess. JWP doesn't want to remove taxonomy slug from url and I wouldn't suggest to use this plugin (it wasn't updated since 2011). –  Krzysiek Dróżdż Jun 22 '13 at 7:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.