• Resolved alexjust

    (@alexjust)


    Hi there, I have some woocommerce product windows on my home page that link to those product pages and my SEO audit is telling me that I should get rid of the nofollow on these product windows. However, there doesn’t seem to be any way to do this. Is there some kind of code snippet that I could use to remove these unwanted default nofollows? Thank you so much!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @alexjust

    To remove the “nofollow” attribute from the product, you can add the following code snippet to your theme’s functions.php file:

    add_filter('woocommerce_loop_add_to_cart_link', 'remove_nofollow_from_product_windows', 10, 2);
    function remove_nofollow_from_product_windows($link, $product) {
    return str_replace('rel="nofollow"', '', $link);
    }

    This code snippet will remove the “nofollow” attribute from your product’s “Add to Cart” links. Please make sure to create a backup of your functions.php file before making any changes, just in case you need to revert to the original version.

    I hope this helps! Thanks.

    Thread Starter alexjust

    (@alexjust)

    Thank you so much! Just to clarify, will this work for all the woocommerce boxes other than the add to cart button? I’m having the same nofollow issue on any window that this woocommerce relate (such as all the windows in my shop page here https://transthetics.com/shop/ will this remove ALL woocommerce nofollows?

    Plugin Support Shameem R. a11n

    (@shameemreza)

    It should works, but I recommend adding the code snippet and checking to confirm it. Sometimes, the success of the solution depends on the theme as well.

    Thread Starter alexjust

    (@alexjust)

    Yes, it seems to work! Thank you SO much! I wonder, would you have any insight as to why woocommerce would add this nofollow seeing it actively hurts SEO?

    Saif

    (@babylon1999)

    Hello @alexjust,

    Glad to hear the suggestion above helped you achieve your goals! ??

    Yes, it seems to work! Thank you SO much! I wonder, would you have any insight as to why woocommerce would add this nofollow seeing it actively hurts SEO?

    I’m not an SEO expert but this article mentions that "Some SEO experts believe that making external links nofollow can help your own WordPress website rank higher. However, this is not proven to be the case." so this seems like an area of debate.

    If you’d like to discuss it further with the developers then feel free to open a new enhancement request on GitHub: https://github.com/woocommerce/woocommerce/issues/new/choose


    Link to image: https://d.pr/i/6iSC9d

    Please let us know if you have any other questions. :?)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[NSFW] Remove nofollow links from woocommerce products’ is closed to new replies.