WooCommerce Shop Page Meta Tags

 

Your WooCommerce shop page is not a normal page for SEO meta title tags and description tags.

Rather, your shop page is a product archive. The title for your shop page is often “Products” and not the title of your WordPress shop page.

It can be difficult to change the page title and meta description to more descriptive values for your SEO.

The PHP code functions shown below will correct the values from the rather annoying:

<title>Products | Bronze Art by William Miles</title>

and

<meta name="description" content="This is where you can add new products to your store."/>

to the more appropriate:

<title>Bronze Castings | Bronze Art by William Miles</title>

and

<meta name="description" content="These are all my unique bronze castings. This list includes all my Bronze Artworks, my Bronze Figurines, and my Bronze Curiosities."/>

You can change your shop page meta tag values by adding the following code to your functions.php file in your theme.

Code


// woocommerce shop page title correction
function woo_shop_title_correction( $title, $sep ) {
	if ( function_exists( 'is_shop' ) && is_shop()) {
		$title = "Bronze Castings " . $sep . " ";
	}
	return $title;
}
add_filter( 'wp_title', 'woo_shop_title_correction', 10, 2 );

// woocommerce shop page description correction
function woo_shop_description_correction( $args ) {
    $args['description'] = __( 'These are all my unique bronze castings. This list includes all my Bronze Artworks, my Bronze Figurines, and my Bronze Curiosities.', 'woocommerce' );
	return $args;
}
add_filter( 'woocommerce_register_post_type_product', 'woo_shop_description_correction', 10, 1 );