Chris Hero

Chris Hero

Mihai was able to translate my vision for the site into Movable Type down to the smallest detail. During the development process he provided lots of feedback on my ideas and he was able to offer multiple solutions for the various features that I wanted to include.

Home ›› Blog ›› WooCommerce ›› Customizing "woocommerce_archive_description" HTML structure in WooCommerce (SEO)

Customizing "woocommerce_archive_description" HTML structure in WooCommerce (SEO)

Optimizing WooCommerce Product Category Pages for Search Engines

At the moment I'm under a 4-weeks contract with a Jewelry manufacturer from Central London for optimizing their website.

We've dealt with lots of items that needed to be addressed for their WordPress WooCommerce website project and we've arrived at the point where I am doing some SEO optimization for them.

Their theme uses some templates that are overwriting the WooCommerce default templates, among them being also:

In this template their previous wordpress developer added two headers, one for the desktop and one for mobile.

Apart from retaining only one of the headings as H1, the one for the desktop, and making the one from the mobile header a regular paragraph with the initial look and feel of the H1, I'm now dealing with the product category description, which is again listed twice, once for the desktop and once for mobile.

I won't insist on the fact that it could have been one single header, made responsive!

In order to change only one of the two occurrences of:

	if ($bg_image) {
		do_action( 'woocommerce_archive_description' );

Which produces:

<div class="term-description"><p>My customer's product category custom description here.</p></div>

With something to produce:

<h2 class="term-description">My customer's product category custom description here.</h2>

I'm replacing the initial coding listed above with:

	if ($bg_image) {
		echo '<h2 class="term-description">' . $queried_object->description . '</h2>';

You're welcome to follow this sample on your WooCommerce project or to hire me for any WooCommerce custom development that you might need.

Kind Regards,
Mihai Bocsaru

Post a Comment