Toolonomy Logo
Last Updated on: October 1, 2022

Remove Post Base Slug from Taxonomy URLs [PHP Snippet]

0 Shares

If your WordPress site has a custom permalink structure but you don't want that default base slug for the taxonomy pages then use this code snippet to remove it.

/* Advanced Scripts Method to Add This Snippet */

add_filter( 'register_taxonomy_args', function( $args, $taxonomy )
{
if( 'category' === $taxonomy && is_array( $args ) )
$args['rewrite']['with_front'] = false;
return $args;
}, 99, 2 );
0 Shares

Become a Toolonomy Community Member for Free!

Consider joining our Official Community Group if you want to get access to exclusive insider content and information about Exclusive Digital Tools and Technologies. Also, you will be able to get involved in interesting group discussions with like-minded people that are interested in similar topics as you.
Become a Member
Toolonomy Logo
Made with ❤ by & for Digital Tool Enthusiasts
Copyright © 2018 - 2024 by SyncWin | All Rights Reserved.

🍪 Cookie Settings
Top crossmenu
0 Shares
Copy link