Inbound Horizons

Providing Small Business Digital Marketing Solutions Since 2010

Fixing the WooCommerce Product Feed description

by

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(
		'the_content',
		$description
	);
	*/
	
	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

Coding & Dev TipsIBH Company BlogWordpress Plugins

Fixing the WooCommerce Product Feed description

Cliff Bailey Jan 5 2018
utah drone video footage
Drone VideographyDrone Videos

Utah From Above - Exclusive 4K Drone Video Footage

Corpusadmin Dec 29 2017
fixing woof products filter plugin
Coding & Dev TipsIBH Company BlogWordpress Plugins

Fixing WooCommerce WOOF Products Filter Price Range After WP 4.8.2 Update

Cliff Bailey Oct 13 2017
colorado drone footage
Drone VideographyDrone Videos

Flying Colorful Colorado By Drone - 4K Video Footage

Admin Oct 6 2017
[contact-form-7 id="273" title="Short Form - Main"]


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