Allow HTML in WordPress Category Description

By default, WordPress doesn’t allow HTML within the category description. However, you can fix this problem by adding a small amount of code to your functions.php file

Useful Read : How to Change the Default Media Upload Location in WordPress

To enable HTML in WordPress category description use the following code,

//Allow HTML Category Description
remove_filter('pre_term_description', 'wp_filter_kses');
Allow HTML in WordPress Category Description

Allow HTML in WordPress Category Description

2 Comments

  1. Hmm question, would allowing HTML here be a possible security risk? Or can the user accidentally break something by putting in bad code in that field? Kind of makes me want to try it and see what happens. 🙂

    Reply
    • Hello Rachel,
      Thanks for commenting.

      If you are the only administrator of your website, then I don’t think allowing HTML will make a difference. But, if you are going to let other users to enter content it category description section, you should stick with proper input sensitization.

      Reply

Leave a Comment.