Allow HTML in Category Description

By default WordPress does not allow HTML formatting in the Post or Custom Post Type category description. Most of the time this is fine as its normally just used for a one sentence description.

But here is a code chunk to add to your functions.php file which will allow you to add things like <strong>, <em>, or <h5> tags in your post category descriptions.

/* Allow HTML in term (category, tag) descriptions */

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' );
}