Allowing HTML in WordPress Profile Descriptions

This is a short, technical post on how to solve a problem with WordPress. I realize it will only apply to some, but it is the answer to those who need it.

The problem is that the profile field for authors in WordPress is very limiting, by default. It strips all HTML out of the field, which means you cannot include links, images, even basic formatting. In my opinion, this is really stupid and I don’t know why the WordPress guys decided to do that. Unfortunately, the way they did it makes use of the filter system in WordPress. To my knowledge, then, you cannot undo it with a plug-in (I may be wrong). The good news is that it is really easy to stop the filter from working.

To do this, open up /wp-includes/registration.php in a text editor. Then, find the following code:

$description = apply_filters('pre_user_description', $description);

Comment it out by putting two slashes in front of it, making it:

//$description = apply_filters('pre_user_description', $description);

This is a quick and dirty way to allow anything into the author description field in WordPress.

Blog Transformation Challenge

Like what you read?

... then take the next step. Register for the 30 Day Blog Transformation Challenge. TRANSFORM your blog by perfecting your writing, optimizing your design, and learning how to optimize the marketing funnel.
Click to Learn More ... or...

  • http://www.betterforbusiness.com Terra Andersen

    I always wondered about that, thanks!

    -Terra
    http://www.BetterForBusiness.com

  • http://www.betterforbusiness.com Terra Andersen

    I always wondered about that, thanks!

    -Terra
    http://www.BetterForBusiness.com

  • http://sokai.name sokai

    //http://wordpress.org/support/topic/121789
    remove_filter('pre_user_description', 'wp_filter_kses');

    Best regards
    Kai

  • http://sokai.name sokai

    Dear David,

    a better solution is to add the following two lines to the functions.php of the theme you are using:
    //http://wordpress.org/support/topic/121789
    remove_filter('pre_user_description', 'wp_filter_kses');

    Best regards
    Kai

  • fimp

    Have you tested this with WordPress 2.5? It doesn’t seem to work on mine.

  • fimp

    Have you tested this with WordPress 2.5? It doesn’t seem to work on mine.

  • http://www.ljcapitalgroup.com/about Brian

    That always bugged me. Thanks so much for the solution.

  • http://www.ljcapitalgroup.com/about Brian

    That always bugged me. Thanks so much for the solution.

  • http://www.kalenga.fr/ Kalenga

    Thank you very much for the tip!

  • http://www.kalenga.fr/ Kalenga

    Thank you very much for the tip!

  • Manuel

    Thank you!

  • Manu

    Now  the following code is in user.php