• Resolved conorneary

    (@conorneary)


    hello,

    The html code is showing up in description. I’m using “Product Short Description” for the description in the feed. I tried to add a wordpress filter to strip the tags, but I don’t know if I’m doing it right because it’s not removing them. Do I need to change the code so it works for “Product Short Description”?

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hello @conorneary,

    Yes, this has been done on request of a user. What version of the plugin are you using so I can give you a code you could try for the filter.

    Thread Starter conorneary

    (@conorneary)

    Hi. I’m using Version 1.12.2

    Thank you.

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Great, you can make use of our wppfm_feed_item_value filter and try this code:

    function strip_tags_from_short_description( $attributes, $feed_id, $product_id ) {
    	$attributes['post_excerpt'] = strip_tags( $attributes['post_excerpt'] );
    	return $attributes;
    }
    
    add_filter( 'wppfm_feed_item_value', 'strip_tags_from_short_description' );

    Let me know if it works.

    Thread Starter conorneary

    (@conorneary)

    Thanks, do I just plug this in Code Snippets and Run snippet everywhere? It doesn’t seem to be working if I do that. How do I use of our wppfm_feed_item_value filter ?

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Yes, that’s the easiest way to get it running. Copy past the code in a new Snippet, activate it (can be done as a run snippet everywhere) and it should work.

    More information about our wppfm_feed_item_value filter can be found here: https://gist.github.com/Auke1810/c62bb043926f539f9a99b418c06a3e6e

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hi @conorneary,

    Where you able to get the code running?

    Thread Starter conorneary

    (@conorneary)

    Hi, no I wasn’t able to, but found another work around. Thanks for your help.

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    OK, good to hear. Could you share your work around so it might help other people and maybe I can integrate this work around in the plugin?

    Hoi Michel,

    Same issue here, just copied the exact code above in a snippet that runs everywhere.
    The difference in my situation is that the field with html tags to clean is ‘description’, output xml is g:description.
    Can you help me please?

    i can give you the URL of the feed in PM if you like.

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hi Chris,

    Let’s first try this code then:

    function strip_tags_from_short_description( $attributes, $feed_id, $product_id ) {
    	$attributes['description'] = strip_tags( $attributes['description'] );
    	return $attributes;
    }
    
    add_filter( 'wppfm_feed_item_value', 'strip_tags_from_short_description' );
    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hello Chris,

    Where you able to solve the issue using this code?

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hello Chris,

    I hope we were successful in helping you resolve your issue with our Feed Manager plugin! Since we have not heard back from you in the past 2 weeks and we don’t want to leave tickets open forever, I will now be marking this support topic as resolved. However, if we still haven’t resolved your issue please reach out to us as we would be more than happy to further assist you!

    Thanks and have a great day!

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘HTML code showing in Google Shopping’ is closed to new replies.