Do you want to remove the uncategorized category in your WooCommerce store? If you are familiar with WordPress, you may have noticed the word “Uncategorized” in the category section. By default, if you have not added a category to your products, they are added to the uncategorized category.
A category refers to a taxonomy, which is used to group and select related posts together. They help the webmaster to order their content.
You should remove the uncategorized taxonomy because it makes your website have an unprofessional look. Additionally, your content will lack logical coherence.
If you remove this category, it will increase the readers’ satisfaction.
How to Remove Uncategorized Category In WordPress WooCommerce
In this post, we will share how you can remove uncategorized categories in your store. We will be using a custom code snippet to remove this category. This means that you need to have some coding skills before you proceed.
Ensure that you take a full backup of your site so that you can revert to the original version if you encounter a problem.
Let us see how you can achieve this.
Steps to Remove Uncategorized Category in WordPress
Here are the steps you need to follow:
- Log into your WordPress site and access the Dashboard as the admin user.
- From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will remove the uncategorized category.
- Add the following code to the php file:
* in Woocommerce
*/
function njengah_hide_selected_terms( $terms, $taxonomies, $args ) {
$new_terms = array();
if ( in_array( ‘product_cat’, $taxonomies ) && !is_admin() && is_shop() ) {
foreach ( $terms as $key => $term ) {
if ( ! in_array( $term->slug, array( ‘uncategorized’ ) ) ) {
$new_terms[] = $term;
}
}
$terms = $new_terms;
}
return $terms;
}
add_filter( ‘get_terms’, ‘njengah_hide_selected_terms’, 10, 3 );
[/php]
Conclusion
By now, you should be able to remove the uncategorized category in WordPress. You can use the same method to remove any category in your store.
The solution we have shared has been tested and works well.
We hope that this tutorial helped to solve your problem.
Similar Articles
- 100+ Tips, Tricks & Snippets Ultimate WooCommerce Hide Guide
- WooCommerce Redirect After Checkout : Redirect to Custom Thank You Page
- How to Fix Yoast SEO Title not Working – Fixing Duplicate Title Tags
- How to Change WooCommerce Checkout Page Title
- How to Add Wishlist In WooCommerce
- 30+ Best WordPress Gallery Plugins for Attractive Galleries
- How to Hide Any Tab My Account Page WooCommerce
- How to Add Search to Shop Page In WooCommerce
- How to Export Products In WooCommerce
- WooCommerce Difference Between PayPal and PayPal Checkout
- How to Add Fields in WooCommerce Registration Form
- How to Remove Product Category Title WooCommerce
- How to Add Custom Add to Cart Button In WooCommerce
- How to Select All Except Last Child In CSS » CSS Not Last Child Example
- How to Add Product SKU In WooCommerce
- How to Set Up WooCommerce Buy One Get One
- How to Add WooCommerce Storefront Product Pagination
- How to Create Custom Category Page In WooCommerce
- How to Add Currency to WooCommerce [Custom Currency]
- How to Create WooCommerce Custom Shop Page