Archived topic
Lightweight social icon“Add rel=”noopener” or rel=”noreferrer”
9 replies · Started by Lilia on July 29, 2019
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
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/
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
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
sure thanks,
Cant add my url as "secret" one as I dident start this topic
Can you try this and let me know if it works:
add_filter( 'lsi_icon_rel_attribute', function() {
return 'noreferrer';
} );
That worked, thank you.
Glad to be of help
needed to change little bit to Lighthouse to accept it.
add_filter( 'lsi_icon_rel_attribute', function() {
return 'rel=noreferrer';
} );
Thanks for sharing