Last Updated on: September 18, 2020

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 );
SyncWin Logo
SyncWin is a dedicated place to explore the Content, Discussions, & Useful Details around topics like Business, Technology, and Lifestyle to help you learn and grow in your life.
About Us
Made with ❤ for WinSyncers
Copyright © 2018 - 2025 by SyncWin | All Rights Reserved.
crossmenuarrow-right
0 Shares
Copy link