If you have more products in a given category and you display several products on a page with pagination enabled then SEO specialists recommend the page title to be unique, and this snippet add the page number to the title.
Category Title page 1
Category Title page 2
Category Title page 3
ā¦
`/* ------------------------------------------- */
// Snippflow Category Title with page number //
/* -------------------------------------------- */
add_filter( 'woocommerce_page_title', 'custom_woocommerce_page_title' );
function custom_woocommerce_page_title( $page_title ) {
if ( function_exists( 'is_product_category' ) && is_product_category() && is_paged() ) {
$current_page = get_query_var( 'paged' );
$page_title .= ' page '. $current_page;
}
return $page_title;
}`
Full article: WooCommerce Category Title with page number
WooCommerce Snippets
Top comments (1)
Useful little SEO improvement for WooCommerce stores with paginated category pages. Adding the page number to category titles helps create unique titles for search engines and avoids duplicate title issues. Simple, lightweight, and very easy to implement.