Support » Plugin: WooCommerce » Can’t Get Rid of Uncategorized Category from Shop Page

  • Resolved casbboy

    (@casbboy)


    I’ve tried custom functions, I’ve tried going through wp-admin to edit some stuff. For the life of me I want the Uncategorized category to not show up.

    How do I hide it?

    I tried this:

    add_filter( 'woocommerce_product_categories_widget_dropdown_args', 'rv_exclude_wc_widget_categories' );
        //* Used when the widget is displayed as a list
        add_filter( 'woocommerce_product_categories_widget_args', 'rv_exclude_wc_widget_categories' );
        function rv_exclude_wc_widget_categories( $cat_args ) {
            $cat_args['exclude'] = array('185'); // Insert the product category IDs you wish to exclude
            return $cat_args;
        }

    Didn’t do anything. I can’t figure out for the life of me how to hide it. I even installed the “Hid Default WooCommerce CAtegory” plugin, and that didn’t work either.

    I just want it off my shop page.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Just rename it to a Category that you have and add there the products or if you don’t add products to that category, it will not show up on shop pages.

    Plugin Support Amanda

    (@amandasjackson)

    Hi there @casbboy,

    As @moutltrex pointed out you can rename and use the category or there is also a way to hide it: https://calebburks.com/hide-uncategorized-default-category-in-woocommerce/

    Thanks for the feedback. okay, I have products in it, but they are all hidden, so it shouldn’t show? Or should I just delete the products entirely? (I used them as templates for new products).

    And, this Plugin: https://calebburks.com/hide-uncategorized-default-category-in-woocommerce/

    I actually have it activated. It doesn’t work, as you can see on the page the Uncategorized still shows up.

    Cheers!
    Ryan

    I finally figured out a code for functions that worked and removed it. Phew!

    add_filter( ‘get_terms’, ‘exclude_category’, 10, 3 );
    function exclude_category( $terms, $taxonomies, $args ) {
    $new_terms = array();
    if ( is_shop() ){
    foreach ( $terms as $key => $term ) {
    if( is_object ( $term ) ) {
    if ( ‘uncategorized’ == $term->slug && $term->taxonomy = ‘product_cat’ ) {
    unset($terms[$key]);
    }
    }
    }
    }
    return $terms;
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t Get Rid of Uncategorized Category from Shop Page’ is closed to new replies.