Remove rel attribute added by Gutenberg WordPress

Remove rel attribute added by Gutenberg WordPress

March 6, 2020

REMOVE REL ATTRIBUTE ADDED BY GUTENBERG, GUTENBERG automatically add rel attribute to the Anchor tag.

Please add the below code in your theme functions.php

//remove rel="noopener noreferrer" added in anchor tag
//below will remove from content and comments
//if rel is different just change rel in code
function remove_nofollow($string) {
	$string = str_ireplace(' rel="noopener noreferrer"', '', $string);
	return $string;
}
add_filter('the_content', 'remove_nofollow');
add_filter('comment_text', 'remove_nofollow');

Please let me know if it works for you. If any issue I will fix my code.

Avada Programmer

Hello! We are a group of skilled developers and programmers.

Hello! We are a group of skilled developers and programmers.

We have experience in working with different platforms, systems, and devices to create products that are compatible and accessible.