10

Is there a way to prevent WP from stripping the HTML from the author bio? I need it to keep my paragraphs.

Thanks in advance! :)

Edit - Although this question has been answered, I will clarify that I was referring to the Bio textarea when editing individual users.

  • The WYSIWYG editor allows html in WordPress so are you referring to some author bio input elsewhere? Please be a bit more specific where you mean. – Brady Jun 28 '11 at 16:00
9

remove the filter that formats the description. put this in your theme's functions.php:

remove_filter('pre_user_description', 'wp_filter_kses');

EDIT - I should mention, if you allow random people to register and add their own bio for display on the site, not filtering that text could enable bad things.

  • Oh, excellent! The solutions I was finding were about editing the core, and this will be much better! Thanks! – 5t3ph Jun 28 '11 at 16:09
  • 10
    Why not add a more permissive filter after removing the default filter? e.g. add_filter( 'pre_user_description', 'wp_filter_post_kses' ); that way, user-input content isn't completely unsanitized. – Chip Bennett Jun 28 '11 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.