Removing HTML and Unwanted Characters from Product Feeds
When preparing your product feeds, especially for channels like Google Shopping, it’s crucial to ensure descriptions are within character limits and free from HTML or shortcode clutter. Here’s how you can clean up your product attributes using the feed manager and additional WordPress tools:
Using Feed Manager’s “Edit Values” Function:
- Access Attribute Mapping: In your feed manager, find the attribute mapping section next to each attribute.
- Edit Values: Click on the “edit values” dropdown to explore editing functions.
- Choose Editing Functions:
- Strip Tags: Removes all HTML tags from your content.
- HTML Entity Decode: Converts HTML entities to their corresponding characters.
- Limit Characters: Truncates the content to a specified number of characters.
- Replace Function: Substitutes specified strings within your content.
Employing WordPress Filters for Advanced Customization:
For more control, especially for users comfortable with PHP, the wppfm_feed_item_value
WordPress filter allows for programmatic alterations to feed items.
- Remove Visual Composer Code: Use PHP code to strip out specific shortcodes, like those from Visual Composer, ensuring cleaner descriptions. (link to script)
- Strip Tags: Implement a filter to remove all HTML tags, keeping only the text content of your descriptions. (link to strip tags)
- Full Clean: For a comprehensive cleanup, remove shortcodes, and Visual Composer markup, and limit the character count to meet channel specifications, such as Google’s preferred 500 characters for optimal user experience.
Example Code Snippet for Full Clean:
Implementing Code Snippets:
For those less experienced with direct code edits, plugins like “Code Snippets” provide a user-friendly interface to apply these customizations. Check out online tutorials for step-by-step guidance on using such plugins to apply your filters.
By following these steps and utilizing the available tools, you can ensure your product feeds are concise, clean, and compliant with channel requirements, enhancing the performance of your online marketing efforts.