Home Forums WoodMart support forum Disable WooCommerce Widgets

Disable WooCommerce Widgets

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #546796

    pavel.vutkow
    Participant

    Can you help me with this for your theme?


    WooCommerce comes pre-loaded with many widgets by default. Most themes have their own functionality to replace these widgets, and keeping them enabled increases the load time while providing no value. You should disable the default widgets to improve your load times.

    Can you share with me what I can disable?

    For example – this is part of widgets:

    add_action( 'widgets_init', 'remove_woo_widgets' );
    
    function remove_woo_widgets() {
      unregister_widget( 'WC_Widget_Recent_Products' );
      unregister_widget( 'WC_Widget_Featured_Products' );
      unregister_widget( 'WC_Widget_Product_Categories' );
      unregister_widget( 'WC_Widget_Product_Tag_Cloud' );
      unregister_widget( 'WC_Widget_Cart' );
      unregister_widget( 'WC_Widget_Layered_Nav' );
      unregister_widget( 'WC_Widget_Layered_Nav_Filters' );
      unregister_widget( 'WC_Widget_Price_Filter' );
      unregister_widget( 'WC_Widget_Product_Search' );
      unregister_widget( 'WC_Widget_Top_Rated_Products' );
      unregister_widget( 'WC_Widget_Recent_Reviews' );
      unregister_widget( 'WC_Widget_Recently_Viewed' );
      unregister_widget( 'WC_Widget_Best_Sellers' );
      unregister_widget( 'WC_Widget_Onsale' );
      unregister_widget( 'WC_Widget_Random_Products' );
    }
    Use this code inside your theme’s functions.php file to disable the default WooCommerce Widgets.

    Thanks

    #547003

    Hello,

    Please follow this guide and disable the widget which you want.
    https://www.wpbeginner.com/plugins/how-to-disable-unwanted-widgets-in-wordpress/

    Best Regards

Viewing 2 posts - 1 through 2 (of 2 total)