In order to remove breadcrumbs from the Storefront theme, the documentation states to add the following in functions.php
:
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
I tried this in a child theme of Storefront and it doesn't work. Tracing back the woocommerce_breadcrumb
, it seems to be added in storefront_content_top
action (in the file <storefront_dir>/inc/woocommerce/storefront-woocommerce-template-hooks.php
. I commented out the corresponding line and indeed the breadcrumbs are hidden.
However, to do this the right way, I try to disable it from the child theme using
remove_action( 'storefront_content_top', 'woocommerce_breadcrumb', 10 );
but it doesn't work. I should clarify that I test this in a fresh child theme with no other code.
How would one disable the breadcrumbs from a child theme?
After clicking that link, you will go to the panel of WordPress Customizer. In this section, choose “Layout”, and select “WooCommerce” before picking up “Single Product”. Here, you choose the checkbox “Disable Breadcrumb” and select the button “Publish”.
In the customization screen, you may see Theme Options as shown in the following image. In other themes, breadcrumb options are located under the Header button. Press the Breadcrumb button to show options. Press the toggle button to disable breadcrumbs, then press the Publish button to apply changes.
All you have to do is head over to All in One SEO » General Settings and then select the Breadcrumbs tab. Next, scroll down to the 'Breadcrumbs Templates' section and select the Taxonomies tab. By default, the plugin will show the parent item link in the breadcrumb on your WooCommerce store.
There are several breadcrumb plugins, including "WordPress Breadcrumbs" and "Yoast Breadcrumbs." Most plugins have "Breadcrumbs" in the title. Click "Deactivate" beneath the plugin to remove the generated breadcrumbs. If you don't see a breadcrumb plugin, it may be automatically included with your theme.
Copy and paste the following snippet into your functions.php file.
add_action( 'init', 'z_remove_wc_breadcrumbs');
function z_remove_wc_breadcrumbs() {
remove_action( 'storefront_before_content', 'woocommerce_breadcrumb', 10);
}
since Storefront 2.3.1 try this
add_action('init', 'dp_remove_wc_breadcrumbs');
function dp_remove_wc_breadcrumbs(){
remove_action('storefront_before_content', 'woocommerce_breadcrumb', 10);
};
Try this:
add_filter( ‘woocommerce_get_breadcrumb’, ‘__return_false’ );
remove_action( 'woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With