Title: Sanitize string tegory%
Last modified: August 30, 2016

---

# Sanitize string tegory%

 *  Resolved [Cornelis Scheltinga](https://wordpress.org/support/users/cscheltinga/)
 * (@cscheltinga)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/sanitize-string-category/)
 * I want to add a global variables on post/page variables:
 * Name: category
    Value: %category%
 * Since this field uses the function sanitize_text_field(); it strips out the “%
   ca” leaving the string “tegory%”.
 * So I see no way to add categories to the datalayer.
 * [https://wordpress.org/plugins/metronet-tag-manager/](https://wordpress.org/plugins/metronet-tag-manager/)

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

 *  Plugin Author [Ronald Huereca](https://wordpress.org/support/users/ronalfy/)
 * (@ronalfy)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sanitize-string-category/#post-6806527)
 * Sorry for the delay, there was no way for me to view this support request because
   it had an % in the URL.
 * I filed a GitHub issue for this: [https://github.com/ronalfy/metronet-tag-manager/issues/2](https://github.com/ronalfy/metronet-tag-manager/issues/2)
 * I’ll try to fix it this weekend.
 * In the meantime, maybe use `post_category` instead.
 * I have example code you can use here: [https://github.com/ronalfy/metronet-tag-manager#filtering-variables](https://github.com/ronalfy/metronet-tag-manager#filtering-variables)
 *  Plugin Author [Ronald Huereca](https://wordpress.org/support/users/ronalfy/)
 * (@ronalfy)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sanitize-string-category/#post-6806529)
 * This is fixed with version 1.1.0

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

The topic ‘Sanitize string tegory%’ is closed to new replies.

 * ![](https://ps.w.org/metronet-tag-manager/assets/icon-256x256.jpeg?rev=2788992)
 * [Metronet Tag Manager](https://wordpress.org/plugins/metronet-tag-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/metronet-tag-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/metronet-tag-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/metronet-tag-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/metronet-tag-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/metronet-tag-manager/reviews/)

## Tags

 * [datalayer](https://wordpress.org/support/topic-tag/datalayer/)
 * [sanitize](https://wordpress.org/support/topic-tag/sanitize/)
 * [TGM](https://wordpress.org/support/topic-tag/tgm/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ronald Huereca](https://wordpress.org/support/users/ronalfy/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/sanitize-string-category/#post-6806529)
 * Status: resolved