What is Remove Post Base Slug from Taxonomy URLs [PHP Snippet]?

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.

  • Published on: September 18, 2020
  • Updated on: September 18, 2020

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 );

Related Snippets

Keep exploring and sharpen your Bricks Builder skills with more expert snippets tailored just for you.

Explore More Snippets

CSS Snippet to Add Layered Glow Effect in Bricks Builder

This effect creates a soft, luminous glow surrounding any shape or element by layering blurred duplicates. It adds gentle depth and visual focus without overpowering the design, perfect for giving…

Read Now

CSS Snippet to Add Glassmorphism Effect in Bricks Builder

This effect transforms sections of your website or app into translucent glass, allowing just enough of the background to peek through while gently softening it. The result is a sleek,…

Read Now

Disable WordPress Blog Features with a PHP Code Snippet

This code snippet disables all blog-related features in a WordPress site to ensure it functions purely as a business site without blogging capabilities for the admin or front-end users.

Read Now
  • Connect. Learn. Build Together.

    Become part of the WPnomy family; a vibrant, supportive community where freelancers, designers, and agencies come together to share insights, ask questions, and celebrate wins. Here, you’ll find encouragement, real-world tips, and a network of passionate WordPress users ready to help you grow.

    Join Facebook Community
    • Connect with passionate WordPress users who share your goals and challenges.
    • Access practical tips, insider tricks, and real-world solutions tailored for all skill levels.
    • Share your progress, get feedback, and celebrate your wins with a supportive network.
    • Stay updated on the latest WordPress features, tutorials, and community events.
    • Experience friendly mentorship and no-fluff guidance, making web building easier and more fun.
    WPnomy - Default Featured Image

    Connect. Learn. Build Together.

    Become part of the WPnomy family; a vibrant, supportive community where freelancers, designers, and agencies come together to share insights, ask questions, and celebrate wins. Here, you’ll find encouragement, real-world tips, and a network of passionate WordPress users ready to help you grow.

    Join Facebook Community