• Resolved fotske

    (@fotske)


    Hi,

    There is a problem in the feed when the product description (“Product Short Description” in my case) contains a link.
    For example imagine that the product short description is:

    “This amazing product is ideal to make a delicious marble cake.”
    (so there is a link on the webpage to a certain recipe)

    The problem is that this “code” “<a href=”…” is in the XML feed and then is also in the description of the product in Google Merchant Center.

    Could you please make so that your plugin “ignores” this kind of “code” into the descriptions and only writes in the XML feed:
    “This amazing product is ideal to make a delicious marble cake”.

    Thank you very much in advance.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter fotske

    (@fotske)

    What I wanted to show is tranformed into a blue underlined text in my previous question.

    So the product short description is (I hava to add spaces into the real “code” so that it shows on this page):
    “This amazing product is ideal to make a delicious < a href=”https://www.mywebsite.com/recipes/marble-cake/&#8221; target=”_blank” rel=”noopener noreferrer”>marble cake.

    Thread Starter fotske

    (@fotske)

    I hope that you understand what I mean

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hi @fotske,

    Yes I understand what you mean. But the issue is that links are allowed (though not advised) in the description data attribute and I don’t want to destroy feeds of users that currently us a link in the description.

    What you could do though is use the wppfm_feed_item_value filter of our plugin to remove the links from your feed. You can look here to see an example of how to use the wppfm_feed_item_value filter https://gist.github.com/Auke1810/c62bb043926f539f9a99b418c06a3e6e

    If you need further help with it just let me know.

    Thread Starter fotske

    (@fotske)

    Hi,

    So do you mean that the “<a href=…” is visible in the “backoffice” of Google Merchant Center but will be visible as a normal link on which you can click in a Google Shopping ad for example?

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    I have no idea how they come out in the ad. As a plugin developer I don’t have a shop myself so I’m not able to test that. I only see no word in the Feed Specifications that this is not allowed.

    As we have many users I want to be careful to change things like this just on one request. Until now nobody complained about it, so I prefer to leave it like it is and let you use the wppfm_feed_item_value filter which is meant just for this kind of requests.

    Thread Starter fotske

    (@fotske)

    Hi,

    What is the wppfm_feed_item_value filter and where to find it? I don’t find that and I don’t understand what it is.
    I looked at your documentation but I don’t understand because I am not a developer…
    Could you please help me?

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    OK, easiest way is to install and activate the “Code Snippets” plugin (https://www.ads-software.com/plugins/code-snippets/)

    Then open that plugins edit page and click Add New.

    In the Code screen, just below the <?php line, past the following code (be sure to copy all the code):

    function remove_links( $attributes, $feed_id, $product_id ) {
    
    	$attributes['description'] = preg_replace('#<a.*?>(.*?)</a>#i', '\1', $attributes['description']);
    
    	return $attributes;
    }
    
    add_filter( 'wppfm_feed_item_value', 'remove_links', 10, 3 );

    Then click the Save Changes and Activate button below the page.

    Then regenerate your feed and check if it removed the links.

    hello i have a problem my long description product page does not appear
    which you could help me

    Plugin Author AukeJomm

    (@aukejomm)

    Hello @nibacasmirshu

    Are you running our premium version?
    ARe you running a WPML multilanguage site?

    am running my premium version sir

    Plugin Author AukeJomm

    (@aukejomm)

    And are you running a Multilanguage website with the WPML plugin?

    No

    Plugin Author AukeJomm

    (@aukejomm)

    Ok, so does the product description not appear in the product feed?
    What did you select as product description
    Does it occur for all products in the feed?

    Did you use the filter as mentioned above?

    Thread Starter fotske

    (@fotske)

    Hi Michel,

    You said that the easiest way to resolve my problem was to install and activate the “Code Snippets” plugin and to paste the code that you gave.
    If I paste the code into this plugin, can I then uninstall this plugin or do I have to keep this plugin all the time just for that? (because I do not want to have too many plugins)

    In my opinion, according to the Google documentation here () you can not have links into a product description: in “Minimum requirements”, you can see “Don’t include links to your store or other websites”.

    I have a suggestion: instead of the “Code Snippets” plugin, would it be possible to add an option in the Settings of the plugin or in the Settings of the Feed to remove the links from the product descriptions?

    Thank you very much in advance.

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hello @fotske,

    Yes you need to have the Code Snippets plugin active. One other way to implement the code is to include it into the functions.php file of you current theme. But to prevent it from overwriting that code every time you update your theme, you should first make a child theme (see https://www.hostinger.com/tutorials/how-to-create-wordpress-child-theme) and then place the code into the functions.php file of that child theme.

    I’ll make a note to think about a final solution for this. Give me one week to think about it.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Problem with the product descriptions when there are links into it’ is closed to new replies.