[Support request] Lightweight social icon“Add rel=”noopener” or rel=”noreferrer”

Home Forums Support [Support request] Lightweight social icon“Add rel=”noopener” or rel=”noreferrer”

Home Forums Support Lightweight social icon“Add rel=”noopener” or rel=”noreferrer”

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #970743
    Lilia

    Hey there, at first, i love your theme and social icons and have one litte question. Is it possible to implement the recommendation of Google Lighthouse that says: “Add rel=”noopener” or rel=”noreferrer” to each of the links that Lighthouse has identified in my page https://www.eu-rights.com report.”?

    thx
    lili

    #971229
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Thank you! 🙂

    Try this PHP:

    add_filter( 'lsi_icon_rel_attribute', function() {
        return 'rel="nofollow" rel="noopener" rel="noreferrer"';
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #1146714
    Jarko

    I have the same problem, installed the code snippets and added the PHP code above, but it dosent seems to work. Or do i need to do something more than activate the snippet in the code snippets plugin?

    thank you

    #1146902
    David
    Staff
    Customer Support

    Hi there,

    that code should work in code snippets nothing extra to be done.
    If you have a link to the site we can take a look

    #1147106
    Jarko

    sure thanks,

    https://www.khaotipthai.se

    Cant add my url as “secret” one as I dident start this topic

    #1147273
    David
    Staff
    Customer Support

    Can you try this and let me know if it works:

    add_filter( 'lsi_icon_rel_attribute', function() {
        return 'noreferrer';
    } );
    #1147324
    Jarko

    That worked, thank you.

    #1147326
    David
    Staff
    Customer Support

    Glad to be of help

    #1147483
    Jarko

    needed to change little bit to Lighthouse to accept it.

    add_filter( 'lsi_icon_rel_attribute', function() {
        return 'rel=noreferrer';
    } );
    #1147533
    David
    Staff
    Customer Support

    Thanks for sharing

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.