Site icon Experience Wordpress Developer Online – Design Develop and Maintenance Support

How to remove/change Woocommerce breadcrumb bar

I will now discuss How to remove or change Woocommerce breadcrumb bar. These are default screen for product page. Here you can see the breadcrumb bar on top of pages.

Now we need to remove it. To do so please add the following line of code at the end of your theme’s functions.php file of your active child theme (or theme). Save the file and refresh the page.

add_action( 'init', 'woo_remove_breadcrumbs' );
function woo_remove_breadcrumbs() {
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
}

If you want to change “home” text of breadcrumb bar than add the following line of code at the end of your theme’s functions.php file of your active child theme (or theme). Save the file and refresh the page.

add_filter( 'woocommerce_breadcrumb_defaults', 'woo_change_breadcrumb_home_text' );
function woo_change_breadcrumb_home_text( $defaults ) {
    // Change the breadcrumb home text from 'Home' to 'Woocommerce Shop'
     $defaults['home'] = 'Woocommerce Shop';
     return $defaults;
}

If You want to Replace the “home” link URL of breadcrumb bar than add the following line of code at the end of your theme’s functions.php file of your active child theme (or theme). Save the file and refresh the page.

add_filter( 'woocommerce_breadcrumb_home_url', 'woo_breadrumb_home_url' );
function woo_breadrumb_home_url() {
    return 'http://woocommerce.com';
}

If you want to change the breadcrumb separator than add the following line of code at the end of your theme’s functions.php file of your active child theme (or theme). Save the file and refresh the page.

add_filter( 'woocommerce_breadcrumb_defaults', 'woo_breadcrumb_delimiter' );
function woo_breadcrumb_delimiter( $defaults ) {
	// Change the breadcrumb delimeter from '/' to '>'
	$defaults['delimiter'] = ' > ';
	return $defaults;
}
Exit mobile version