Since most of our newer themes use custom post types and taxonomies to handle content such as events, properties or products we started receiving a lot of questions on how to delete custom taxonomy slugs from URLs. We will do this using a plugin called WP htaccess Control available from the plugins directory. Even though the plugin has been available for a while it caused problems with blog categories so we decided not to recommend it. So far I did a quick test of the plugin using our GeoPlaces v4, Real Estate 2 and Emporium themes. It worked great with each one.
So, to remove taxonomy category URLs from your theme do the following:
- Download, install and activate the WP htaccess Control plugin
- Go to wp-admin -> Settings -> htaccess Control and expand the “Remove Taxonomies and Author Base” section
- Inside the section choose the category base you want to remove. The image below is for GeoPlaces v4, it’s one of rare Templatic themes with two category base slugs (places and events)
- Click on “Save all changes” to finish the job
If you did everything correctly the taxonomy category slugs should be removed from your theme. Instead of something like this:
Your category should show like this:
Please Note:
1. The above only works with Post Name permalinks. If you haven’t already, go to wp-admin -> Settings -> Permalinks and choose Post Name.
2. Avoid using the same slug for both blog and event/product/etc categories. It will cause conflicts and issues with the theme. If you have categories with the same name at least make sure that the slug is different
Ok, this solves the category slug problem, you’re probably thinking “What about listing detail pages”? Unfortunately, this plugin can’t be used to remove slugs from detail pages. However, there is a plugin you can use. It’s called custom permalinks and works on a per-post basis. This means you will have to set a custom permalink for each of your places, products, properties or jobs (depending on the theme you use).
So, to remove slugs from detail pages do the following:
- Download, install and activate the Custom Permalinks plugin
- Start creating a new event/property/product/etc inside the back-end and enter the title
- Set the new permalink under the title
- Your permalink can be the same as before just without the event/property/etc prefix or you can enter a completely new permalink. It’s up to you
The plugin works with most of our themes which have custom post types.
If you want to translate taxonomy names inside your theme visit the following document :
Renaming taxonomies
The tutorial is focused on GeoPlaces v4 theme but the general principle can be applied to any other theme. Do this only if you’re an intermediate WordPress user, do not attempt to do this if you just started using WordPress.