There are many WooCommerce stores, which might need to sell products by weight.
For example, you might be selling fruits and vegetables in bulk for resale. If you were selling in bulk, then it would be best if you sell them by weight.
However, you need to add the weight for each product you sell manually.
WooCommerce Hide Weight
However, if you are selling digital products, you might not need to display your product’s weight and dimensions.
Additionally, if you are not shipping the product, there is no need to display the product’s weight.
In this post, you will see how you can hide a product’s weight on the product page. I will share two solutions to do this.
The first one is a beginner-friendly solution that involves tweaking the built-in options for WooCommerce.
The second solution involves the use of a code snippet and requires some technical experience.
However, before we start, it is worth mentioning that your theme will not display the weight and dimensions for a product unless this information is added in the back end.
From the image, you can see I have added the weight, and this is how it is displayed in the front end:
Steps to Hide the Weight of a Product in WooCommerce
Here are the steps that you need to follow:
- Log into your WordPress site and access the Dashboard as the admin user.
- From the Dashboard menu, click on
- Click on the product title you want to remove the weight and scroll down to the product data meta box. Here you need to manually remove the weight of the product on the shipping tab.
- Alternatively, you can remove the weight of the product using a PHP code snippet. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to add the function to hide the products’ weight.
- Add the following code to the functions.php file of the Storefront theme.
/** * Hides the product's weight and dimension on the single product page. */ add_filter( 'wc_product_enable_dimensions_display', '__return_false' );
Conclusion
In summary, this post shares how you can easily hide or remove the weight of a product.
The first method involves removing the product weight individually for each product. The second method hides the weight of all the products on the product page.
However, if you are not familiar with altering code, please consider hiring a developer.
Joe is an experienced full-stack web developer with a decade of industry experience in the LAMP & MERN stacks, WordPress, WooCommerce, and JavaScript – (diverse portfolio). He has a passion for creating elegant and user-friendly solutions and thrives in collaborative environments. In his spare time, he enjoys exploring new tech trends, tinkering with new tools, and contributing to open-source projects. You can hire me here for your next project.
Similar Articles
- How to Add Woocommerce Custom Text Field on a Product Page
- How to Check If Plugin is Active In WordPress [ 3 WAYS ]
- How to Hide Tags In Storefront Theme WooCommerce
- How to Setup Storefront Stock Quantity & Manage Inventory
- How to Remove Footer Storefront Theme WooCommerce
- How to Limit WordPress Excerpt Length Like a Pro
- How to Add WooCommerce Storefront Product Pagination
- How to Customize Storefront Theme Using Customizer
- How to Add WooCommerce Storefront Hero Image
- How to Simplify Checkout Free Items Storefront Theme
- How to Move Primary Menu Storefront WooCommerce
- How to Add Text Before the Price in WooCommerce » Add Text Before Price
- How to Hide Best Sellers WooCommerce Storefront FrontPage
- How to Add or Remove Icons to WooCommerce Checkout Page
- How to Show All Categories on Homepage Storefront Theme
- How to Hide the WordPress Admin Bar Programmatically Without Plugin
- How to Set WooCommerce Storefront Theme Product Page Full Width
- How to Remove Header WooCommerce Storefront Theme
- How to Remove Cart Page WooCommerce Storefront Theme