Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @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

    Hello @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.