When you are creating a Product Feed of your WooCommerce store for your preferred merchant, sometimes you may find some attributes values are showing the correct data but with the wrong format. Or perhaps you may need to modify the current attribute value to meet your merchant’s feed specification.
The “Output Sanitizations” option can help you in this way.
When you are creating a new feed or editing an existing feed with the Product Feed Manager, on the right side of the attributes you will find a dropdown option “Output Sanitization”.
For example, if you want to remove the decimal segment from your price attribute, just change the Output Sanitization for the Price attribute as “Price”, and it will remove the decimal segments from your price attribute.
Let me show the Output Sanitization options and their purposes:
Click on the Output Sanitization dropdown, and you will the following options:
Here you will get the following options:
- Strip Tags
- UTF-8 Encode
- Remove Space
- Remove ShortCodes
- Remove ShortCodes and Strip Tags
- Remove Special Character
- CDATA Without Space
- Remove Undersoce
- Decode URL
- Remove decimal points
- Two decimal points
- Remove hyphen
- Remove hyphen (space)
- Replace space with hyphen
Default: It will keep the attribute value as it is.
UTF-8 Encode: It will encode the UTF-8 values of the attributes.
htmlentities: htmlentities will convert the HTML entities into symbols.
Integer: Selecting Integer will only keep the integers from the attribute value.
Price: Price will remove the decimal segment from the attribute value.
Remove Space: This Sanitization filter will remove the spaces from the attribute value.
Remove ShortCodes: It is one of the most important Sanitizations that will remove all the shortcodes from your attribute value.
Remove ShortCodes and Strip Tags: Using this Sanitization will remove all the tags and the shortcodes from your attribute value.
Remove Special Character: Selecting this will remove any special characters from your attribute value.
CDATA: CDATA means, Character Data, it will put the attribute value into the CDATA tags.
CDATA Without Space: This Sanitization will put the attribute value into the CDATA tags, and there won’t be any space after the CDATA tag.
Remove decimal points: Selecting this Sanitization will remove the decimal points from the attribute value.
Two decimal points: Selecting this Sanitization will show two decimal points of the attribute value.
Remove hyphen: This will remove any hyphen from the attribute value.
Remove hyphen (Space): This will remove any hyphen from the attribute value – hyphen with spaces.
Replace space with hyphen: This Sanitization will replace all the spaces with hyphens.
Now, select the required Output Sanitization for the concerned attribute and publish the feed.
Once the feed is published, then you will see that the attribute result has changed within the feed file.