In a WooCommerce-powered website, the shop page is the main page that displays all of the products available for purchase. By default, the title of this page is “Shop”. However, sometimes the title may not accurately reflect the content on the page or may not be the desired title for the page. In this article, we will look at how to use the add_filter() function in WordPress to change the title of the WooCommerce shop page to something more suitable.

Use below code for replace woocommerce shop page title. Copy below code and paste in your theme funtions.php file

add_filter( 'woocommerce_page_title', 'woo_shop_page_title');

function woo_shop_page_title( $page_title ) {

if( 'Shop' == $page_title) {

return "Products";

}

}

This code is using the add_filter() function to modify the title of the WooCommerce shop page. The function takes two parameters: the first is the “woocommerce_page_title” filter, which is used to filter the title of the shop page, and the second is the name of the custom function “woo_shop_page_title” that will be used to modify the title.

The custom function “woo_shop_page_title” takes one parameter, which is the current page title. Inside the function, there is an if statement that checks if the current page title is “Shop”. If it is, the function returns the string “Products” as the new title.

By using this code and paste it in your theme’s functions.php file, the title of the WooCommerce shop page will be replaced from “Shop” to “Products” on your website.

It’s worth mentioning that, this code only change the title of the shop page, it will not change the title of other pages that have “Shop” in the title, so it’s best to test it after applying the code.

Conclusion:

By using the add_filter() function in WordPress, we can easily change the title of the WooCommerce shop page to something more suitable. This can help to make the website more organized and user-friendly. It is important to test the code after pasting it in the functions.php file, as it will only change the title of the shop page, not other pages with “Shop” in the title. This code snippet is a simple yet effective solution for customizing the title of the shop page in a WooCommerce-powered website.