Title: Adding rel-noopener/noreferrer Link
Last modified: June 3, 2020

---

# Adding rel-noopener/noreferrer Link

 *  Resolved [glenderman](https://wordpress.org/support/users/glenderman/)
 * (@glenderman)
 * [6 years ago](https://wordpress.org/support/topic/adding-link-4/)
 * Hi
 * I’ve been analysing my website using Google’s Lighthouse tool, and under the “
   Best Practices” tab it flags my social media icons that I use Hustle for.
 * This recommends adding a rel=”noopener” or rel=”noreferrer” to these links.
 * Here is the relevant reading from web.dev:
 * [https://web.dev/external-anchors-use-rel-noopener/?utm_source=lighthouse&utm_medium=devtools](https://web.dev/external-anchors-use-rel-noopener/?utm_source=lighthouse&utm_medium=devtools)
 * Could this possibly be added to any social share links as it would improve best
   practice score of most likely all websites who use Hustle.
 * Thanks
    -  This topic was modified 6 years ago by [glenderman](https://wordpress.org/support/users/glenderman/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Imran – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support9/)
 * (@wpmudev-support9)
 * [6 years ago](https://wordpress.org/support/topic/adding-link-4/#post-12940977)
 * Hello [@glenderman](https://wordpress.org/support/users/glenderman/)
 * I trust you’re doing well!
 * Would you please try the following solution. Add this code to a child’s theme
   functions.php file:
 *     ```
       add_filter( 'hustle_render_module_markup', function( $html, $renderer, $render_id, $sub_type, $post_id ){
       	if ( 'floating' !== $sub_type ) {
       		return $html;
       	}
       	$doc = new \DOMDocument('1.0', 'UTF-8');
       	libxml_use_internal_errors( true );
       	$doc->loadHTML( $html );
       	libxml_use_internal_errors( false );
       	$xpath = new DOMXPath( $doc );
       	$nodes = $xpath->query( "//*[contains(@class, 'hustle-share-icon')]" );
       	foreach ( $nodes as $key =>$node ) {
       		$node->setAttribute( 'rel', 'nofollow' );
       	}
       	return $doc->saveHTML();
       }, 20, 5 );
       ```
   
 * In case there is no child theme, please create a mu-plugin. Create a file and
   name it **hustle-render-module-markup.php**. Add `<?php` to a first line and 
   then the rest of the above code.
 * Upload the file to `/wp-content/mu-plugins/` directory. if the mu-plugins folder
   is not there, please feel free to create it.
 * Have a good day!
 * Cheers,
    Nastia
 *  Plugin Support [Imran – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support9/)
 * (@wpmudev-support9)
 * [6 years ago](https://wordpress.org/support/topic/adding-link-4/#post-12968331)
 * Hello [@glenderman](https://wordpress.org/support/users/glenderman/)
 * I hope you are doing well!
 * We haven’t heard back from you for a while now so we’ve marked this ticket as
   resolved. If you do have any followup questions or require further assistance
   feel free to reopen it and let us know here.
 * Kind regards,
    Nastia

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding rel-noopener/noreferrer Link’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popup/assets/icon-256x256.gif?rev=3446944)
 * [Hustle - Email Marketing, Lead Generation, Optins, Popups](https://wordpress.org/plugins/wordpress-popup/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popup/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popup/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popup/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Imran – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support9/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/adding-link-4/#post-12968331)
 * Status: resolved