Woocommerce

How To Remove Unwanted Widgets In WooCommerce

Here we learn about how to remove unwanted widgets in WooCommerce.

You can unregister of default WooCommerce widgets class names.

I found widget names directly from the code here: woocommerce\includes\wc-widget-functions.php.

Syntax :

<?php unregister_widget( string|WP_Widget $widget ); ?>

It is useful for un-registering default widgets. and this executes with a function hooked ‘widgets_init’ action.

Custom code copied and paste into your child theme’s functions.php file.

If you remove ‘Filter Products by Rating’ widget. see the below example.

Example:

<?php
add_action( 'widgets_init', function(){
  unregister_widget( 'WC_Widget_Rating_Filter' );  
});
?>

The following list of WooCommerce widgets.

  • unregister_widget( ‘WC_Widget_Cart’ ) – For Cart.
  • unregister_widget( ‘WC_Widget_Layered_Nav_Filters’ ) – For Active Product Filters.
  • unregister_widget( ‘WC_Widget_Layered_Nav’ ) – For Filter Products by Attribute.
  • unregister_widget( ‘WC_Widget_Price_Filter’ ) – For Filter Products by Price.
  • unregister_widget( ‘WC_Widget_Product_Categories’ ) – For Product Categories.
  • unregister_widget( ‘WC_Widget_Product_Search’ ) – For Product Search.
  • unregister_widget( ‘WC_Widget_Product_Tag_Cloud’ ) – For Product tag Cloud.
  • unregister_widget( ‘WC_Widget_Products’ ) – For Products.
  • unregister_widget( ‘WC_Widget_Rating_Filter’ ) – For Filter Products by Rating.
  • unregister_widget( ‘WC_Widget_Top_Rated_Products’ ) – For Products by Rating.
  • unregister_widget( ‘WC_Widget_Recent_Reviews’ ) – For Recent Product Reviews.
  • unregister_widget( ‘WC_Widget_Recently_Viewed’ ) – For Recent Viewed Products.
Rahul Prajapat

I’m Rahul Prajapat. I’m a WordPress developer and Author at TheCodeHubs. I have good skill of Html, CSS, JQuery, SQL, Web API, PSD to HTML/PSD to WordPress, WordPress Theme/Plugin Customization, create or modify short code, customize visual composer short code or integrate new short code with visual composer, can create custom metabox for any post type in WordPress admin.

Share
Published by
Rahul Prajapat

Recent Posts

Testing hk

Testing

1 year ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

1 year ago

Operation

Testing

1 year ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

1 year ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

1 year ago

TETS NEW

test

2 years ago