WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to allow HTML to be rendered in Category descriptions? My theme uses them quite a lot, and I'd like to style them better with images and links.

This seems to be do-able from what I read elsewhere, but I wondered if there is a best practice to get it to work (I'd prefer not to use a barely supported plugin).

Many thanks,


share|improve this question

The HTML is stripped by wp_filter_kses(). So this should work:

remove_filter( 'pre_term_description', 'wp_filter_kses' );

When you want to print that content, use wpautop():

echo wpautop( term_description() );
share|improve this answer
Thanks, I'll give that a go later tonight. – EILrichard May 2 '13 at 10:29
I found this on the woocommerce blog which seems to work to an extent (i can now add links and images to the description) but it won't let me use spaces or paragraphs (br or p). Any idea why? See next comment... – EILrichard May 2 '13 at 11:24
foreach ( array( 'pre_term_description' ) as $filter ) { remove_filter( $filter, 'wp_filter_kses' ); } foreach ( array( 'term_description' ) as $filter ) { remove_filter( $filter, 'wp_kses_data' ); } – EILrichard May 2 '13 at 11:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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