wp_rel_nofollow()
Adds rel nofollow string to all HTML A elements in content.
No Hooks.
Return
String
. Converted content.
Usage
wp_rel_nofollow( $text );
- $text(string) (required)
- Content that may contain HTML A elements.
Changelog
Since 1.5.0 | Introduced. |
Code of wp_rel_nofollow() wp rel nofollow WP 5.9.3
function wp_rel_nofollow( $text ) { // This is a pre-save filter, so text is already escaped. $text = stripslashes( $text ); $text = preg_replace_callback( '|<a (.+?)>|i', static function( $matches ) { return wp_rel_callback( $matches, 'nofollow' ); }, $text ); return wp_slash( $text ); }