Skip to content

Snippet: Remove rel “noreferrer” from theme blank target links

By default the total theme adds rel "noreferrer" to links that open in a new window (target="_blank") for security reasons, however, if you wish to remove them you can using the following snippet. Now, this will only remove them from links added by the theme, WordPress still adds rel noreferrer to links inserted into your post content automatically and it would require a different snippet/plugin to remove them.

/**
 * Remove rel "noreferrer" from theme blank target links.
 *
 * @link https://total.wpexplorer.com/docs/snippets/remove-target-link-rel-noreferrer/
 */
add_filter( 'wpex_targeted_link_rel', function( $targeted_rel ) {
	$targeted_rel = 'noopener';
	return $targeted_rel;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top