Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide product title and categories on product page

How could I hide product title and categories on a single product page in WooCommerce: enter image description here

I know I can edit/comment the source code but then I have to manually do it after each update. Is there a function I can add to theme functions.php that can remove product title and categories from single product page?

like image 855
user1833760 Avatar asked Mar 24 '23 01:03

user1833760


2 Answers

For compatibility with future updates of your theme and plugins, I've found a better way to do this is through WooCommerce hooks. To remove both the title and the meta-data items from your Single Product Page, you should put the following two lines in your theme's main functions.php:

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );

You can find more info about changing, or re-ordering your Product Page Contents in this post.

like image 151
prms Avatar answered Apr 06 '23 01:04

prms


Simplest Solution is go to woocommerce plugin /templates/single-product/title.php and remove content of this file.

Same process can be done by removing content of meta file in same directory.

like image 22
Balram Singh Avatar answered Apr 06 '23 01:04

Balram Singh