EZ Exporter: Function to Strip HTML Tags is Now Available

We've recently gotten this request from one of our customers. He needed a way to export the product description of his products but without the HTML code.

Shopify's own product CSV export includes the HTML code of the product description in a field labeled "Body (HTML)." The Shopify API also only provides the HTML version of the product description.

As a way around this, we've added a new function in EZ Exporter to remove the HTML code for you so you'll have a cleaner-looking CSV file with just the product description text. We called this function strip_html_tags() and can be used for any field that contains HTML in the Calculated Fields section of our app.

For example, in this particular case, all you need to do is place the field inside the function like this:

strip_html_tags({{ body_html }})

If the body_html field originally looks something like:

<p><strong>Hello Shopify store owner!</strong></p>

It will now look like this:

Hello Shopify store owner!

You can even go a step further and truncate the product description. For example, if you have a really long product description and you only want to see the first 100 characters (say, to simply preview what the product is about), you can do something like this as well:

strip_html_tags({{ body_html }})[:100]

This will basically only include the first 100 characters of the product description (after removing the HTML tags). This could also come in handy if you need to import your products to another system which has a limit on the number of characters that can be used.

Tags: new features, shopify, csv export, ez exporter, reporting