Title: [Plugin: Tag Groups] small problem: saving terms strips out html
Last modified: August 20, 2016

---

# [Plugin: Tag Groups] small problem: saving terms strips out html

 *  Resolved [Ahni](https://wordpress.org/support/users/ahni/)
 * (@ahni)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-tag-groups-small-problem-saving-terms-strips-out-html/)
 * Hey again. I just noticed, whenever I save a term now it strips out any images
   and basic html (links, italics) I’ve added in. Up to now I’ve been using [this code](http://wordpress.stackexchange.com/a/5403)
   so that I can use html in descriptions. I also just tested with the plugin “Rich
   Text Tags, Categories, and Taxonomies” but it’s the same thing. I can add html
   no problem, but the second I save it it’s gone.
 * [http://wordpress.org/extend/plugins/tag-groups/](http://wordpress.org/extend/plugins/tag-groups/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-tag-groups-small-problem-saving-terms-strips-out-html/#post-3059841)
 * You mean it has to do with the plugin? If you disable the plugin, put html in
   the description and save the term, it is still there?
    The only thing I could
   imagine where it happens is in the plugin line 227:
 *     ```
       if ( isset($_POST['description']) && ($_POST['description'] != '') ) $term['description'] = stripslashes(sanitize_text_field($_POST['description']));
       ```
   
 * You could try to remove the sanitize_text_field( ) and see if that helps.
 *  Thread Starter [Ahni](https://wordpress.org/support/users/ahni/)
 * (@ahni)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-tag-groups-small-problem-saving-terms-strips-out-html/#post-3059976)
 * Yes, it’s definitely a plugin issue. As soon as I disabled it, all my html was
   preserved as per usual.
 * I tried removing sanitize_text_field( ) like you suggested, specifically
 * > sanitize_text_field($_POST[‘description’])
 * Unfortunately, when I saved tried saving a term, it deleted the entire description!
 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-tag-groups-small-problem-saving-terms-strips-out-html/#post-3060016)
 * sorry, my suggestion was somewhat ambiguous. Actually I meant only to take out
   the function, but leave the inner bit $_POST[‘description’] .
    That line would
   thus become:
 *     ```
       if ( isset($_POST['description']) && ($_POST['description'] != '') ) $term['description'] = stripslashes($_POST['description']);
       ```
   
 * I tested the change here and it seems to make a difference.
    I did not know that
   html is allowed in the description but it indeed makes sense.
 *  Thread Starter [Ahni](https://wordpress.org/support/users/ahni/)
 * (@ahni)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-tag-groups-small-problem-saving-terms-strips-out-html/#post-3060086)
 * Hooray, it worked!! I owe you one, big time, for making this plugin and for the
   awesome support. Thank you!
 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-tag-groups-small-problem-saving-terms-strips-out-html/#post-3060101)
 * You are welcome! And thank you for testing!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: Tag Groups] small problem: saving terms strips out html’ is 
closed to new replies.

 * ![](https://ps.w.org/tag-groups/assets/icon-256x256.png?rev=2853023)
 * [Tag Groups is the Advanced Way to Display Your Taxonomy Terms](https://wordpress.org/plugins/tag-groups/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tag-groups/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tag-groups/)
 * [Active Topics](https://wordpress.org/support/plugin/tag-groups/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tag-groups/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tag-groups/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Christoph](https://wordpress.org/support/users/camthor/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-tag-groups-small-problem-saving-terms-strips-out-html/#post-3060101)
 * Status: resolved