How to Remove Page Titles from Woocommerce Pages

In this tutorial, you will learn how to remove page titles from woocommerce pages. Woocommerce comes with a lot of hooks and filters, so we are going to use a filter to do this job.

[pastacode lang=”php” manual=”function%20wc_hide_page_title()%0A%7B%0A%09return%20false%3B%0A%7D%0Aadd_filter(%20’woocommerce_show_page_title’%2C%20’wc_hide_page_title’%20)%3B” message=”” highlight=”” provider=”manual”/]

The above code will remove titles from all woocommerce pages. In case, you want to remove it from a specific page then we need to use conditional tags available in woocommerce. Lets remove titles from Shop page only.

[pastacode lang=”php” manual=”function%20wc_hide_page_title()%0A%7B%0A%09if(%20!is_shop()%20)%20%2F%2F%20is_shop%20is%20the%20conditional%20tag%0A%09%09return%20true%3B%0A%7D%0Aadd_filter(%20’woocommerce_show_page_title’%2C%20’wc_hide_page_title’%20)%3B” message=”” highlight=”” provider=”manual”/]

The above code will return true in case the current page is not a shop page. Hence, the title will be displayed on pages other than Shop page.