Make Money eBooks

Discover the formulas that are bringing in more than $2500 per month for me from simple Blogging and Affiliate Marketing. Get insider tips on how to Make More Money from your Blog as well as how to bring thousands of new visitors to your Blog for FREE!!

Enter your details to download the eBooks

Download The eBooks Now!!

We respect your privacy!

How To Allow HTML in WordPress Author Bio | WordPress Plugin

WordPress by default stripes out HTML formatting from the Author’s Bio in profiles due to the possibilities of malicious activities from any author level users. However, you may need this if you trust your authors and show the author bio in their posts to give the credit they deserves.

When I searched on Google for how to allow html in author bio, I got results which deal with editing one of the core WordPress file ‘wp-includes/user.php‘. This has two drawbacks, first, you will lost the customization whenever you upgrade WordPress and second, this poses a major security risk as all type of HTML formatting will be possible within the author bio.

I played with the WordPress functions plus searched for some alternative solution and I found a working solution which doesn’t need editing of any WordPress core file. All you need is adding two lines of code in your theme’s ‘functions.php‘ file.

Open your theme’s functions.php file and add these lines just before the closing php tag (?>).

remove_filter('pre_user_description', 'wp_filter_kses');
add_filter( 'pre_user_description', 'wp_filter_post_kses' );

The first line totally removes the stripping of html formatting from the description (bio) field and the second line sanitize content for allowed HTML tags for post content. Once you put this up, you can go and use all the HTML formatting allowed in posts in author’s bio.

If you don’t want to edit the theme file, here I have made a plugin for you. Just upload the folder in your ‘wp-plugin’ folder and activate it from plugins menu.

 
Download the Plugin

Article by

Hi, I am Abhik and this is my blog ItsAbhik.com. I write about Search Engine Optimization (SEO) and Search Engine Marketing (SEM) here and provide tips on how you can make money online..

Abhik has written 568 awesome articles for us at Make Money Online with Abhik

Twitter: @itsabhik | Facebook | Google+ | Blog → Make Money Online with Abhik

Submit a Post

{ 5 comments… read them below or add one }

Amrik Bhattacharjee April 6, 2012 at 5:49 pm

Hi
Its really gr8
I am using Thesis Theme in Wordpress. Can I use this ?

Reply

R. Richard Hobbs February 14, 2012 at 10:59 pm

Code works in 3.31 using http://codex.wordpress.org/Must_Use_Plugins will probly work in a child theme functions file as well. – thanks :)

Reply

Roy January 20, 2012 at 3:27 am

“Discover The Power Of WordPress�?NOT “rocket science�? language�? dress bitter

Reply

Tarkan Taco Esin August 27, 2011 at 4:14 pm

Great Job Abhik, nothing worked, till i tried yours. Thanks alot.

Greetz from Germany.

Taco

Reply

Junaid August 14, 2011 at 11:14 pm

That’s a nice feature… thanks for sharing

Reply

Leave a Comment


Previous post:

Next post: