Inbound Horizons

Providing Small Business Digital Marketing Solutions Since 2010

Fixing the WooCommerce Product Feed description


After fixing the description in the XML file created by the WooCommerce Google Product Feed plugin we decided to share our solution. The problem was with the product feed description being set as HTML code instead of plain text which makes it unreadable.

Product Feed Description BEFORE being fixed

Fixing the product feed description was surprisingly simple and easy to do. First of all, access your WordPress website’s directory using FTP. Next, navigate to wp-content/plugins/woocommerce-product-feeds/woocommerce-gpf-feed-item.php. Open that file and scroll down to the function “get_product_description()” near line 434. Go to the end of the function, comment out the return statement, and replace it with the following PHP code.

	// Comment out the original return statement
	return apply_filters(
	return ($description);	// Return the plain text description

Finally, save your changes.
After saving your code and reloading your XML file your description should appear just like it ought to.
Product Feed Description AFTER being fixed

So why does this work? The original return statement called the function “apply_filters()”. However, this takes the plain text description and formats it to be displayed as HTML code on the website (apply_filters(‘the_content’, string $content)). (Hence why it originally showed the HTML code as the product feed description.) But the Google Merchant Center only wants the plain text description. So we skipped over the function that formats the description for the website and directly returned the plain text of the description.

Leave a Reply

thailand 4K travel video
Drone VideographyDrone Videos

Thailand By Drone - Our 4K Travel Video Of Phuket, Phi Phi Islands & Krabi

Corpusadmin Aug 23 2018
oregon drone footage
Drone VideographyDrone Videos

Oregon By Drone - Exclusive 4K Footage - Pacific Coast, Whale Watching, Portland Views & More

DML Mar 28 2018
hawaii oahu drone footage
Drone VideographyDrone Videos

Hawaii By Drone - Our Exclusive 4K Oahu Aerial Footage - Waikiki, Hanauma & More

DML Mar 28 2018
[contact-form-7 id="273" title="Short Form - Main"]

[contact-form-7 id="319" title="Rep Form - Main"]
I Am Interested In: