add_filter('pre_user_description','wpse_whitelist_tags_in_bio');
function wpse_whitelist_tags_in_bio($description){
$bio_allowed_tags = array(
'strong'=>array(),
'em'=>array(),
'b'=>array(),
'i'=>array(),
);
$description = wp_kses($description,$bio_allowed_tags);
return $description;
}
this will allow only the HTML tags you want, notice I’m allowing <b> <i> and but nothing else. You’ll have to re-save all user profiles to retroactively remove all the other tags.
Thanks for your code.
Let me try this one also.
I tried the below code it worked well in few themes.
add_filter( ‘get_the_author_description’, ‘remove_html_link’ );
function remove_html_link($link) {
$end = preg_replace(‘#<a.*?>#i’, ”, $link);
return $end;
}
But on my website [https://www.whatiswhatis.com/], there are 2 functions that are calling for the author description.
Anyway, I hired the WordPress developer, he solved it.
-
This reply was modified 3 years, 2 months ago by Prabhakar.