• Resolved tddnames

    (@tddnames)


    Really like the product review block.

    But there’s a critical thing missing.

    On the button links (when linking to affiliate partners) there needs to be an option to set either rel=”nofollow” or rel=”sponsored” attribute.

    Please add this feature pronto, or alternatively, do you know if there’s a “hack” to do it?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Hey @tddnames,

    Thank you for the suggestion. Would it be fine if we have it rel="nofollow" by default, and give users a checkbox to make it rel="sponsored"?

    Right now there’s no way to do it unless you are willing to edit the code. Let me know if you are comfortable doing that.

    Thread Starter tddnames

    (@tddnames)

    Hey Hardeep, fantastic! That would be a really great option (nofollow as default, sponsored as a checkbox option). Yeah I’m comfortable with editing the code. Thanks Matt

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Hey @tddnames,

    For now, you will have to edit this line: https://github.com/Codeinwp/gutenberg-blocks/blob/master/inc/render/class-review-block.php#L231

    You will find it inside /vendor/codeinwp/gutenberg-blocks/inc/render/class-review-block.php file.

    Let me know if it helps!

    Thread Starter tddnames

    (@tddnames)

    Thanks lots! I changed row 231 to

    $html .= ' <a href="' . $link['href'] . '" target="_blank"' . '" rel="sponsored">' . $link['label'] . '</a>';

    however, bit of a problem. In the plugin editor the /inc/ folder isn’t showing, only the below can be edited.

    otter-blocks.php
    CHANGELOG.md
    assetsfolder
    buildfolder
    class-otter-blocks.php
    readme.txt
    readme.md

    I tried to copy the entire /inc/ folder (and everything in it) from https://github.com/Codeinwp/gutenberg-blocks to /wp-content/plugins/otter-blocks/inc/

    and I made the above change to row 231 in /inc/render/class-review-block.php BUT this change doesn’t override plugin file, and the rel=”sponsored” attribute isn’t there in the HTML sourcecode

    Any further help would be very much appreciated!

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Hey @tddnames,

    You don’t need to copy it. They already exist. It’s just WordPress’ file editor ignores the vendor folder for technical reasons.

    You should be able to see it when you edit via FTP or by installing WPIDE plugin and using that to edit files.

    Let me know how it goes!

    Thread Starter tddnames

    (@tddnames)

    Awesome, works now! Thank you very much!

    FYI if anyone else is doing this, here’s the correct syntax (above had an extra ” in the code.

    $html .= ' <a href="' . $link['href'] . '" target="_blank"' . 'rel="sponsored">' . $link['label'] . '</a>';

    Hello @hardeepasrani Can you please add NoFollow link for Buttons in Next Update?? Its really important. Also, you should add most of the WP Product Review Plugin features in this. I wanted to Buy Pro but looks like it is discontinued. So it will be perfect if you add features to Otter.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Product Review Block – Nofollow on links’ is closed to new replies.