Title: Escaping htmlentities
Last modified: April 13, 2022

---

# Escaping htmlentities

 *  Resolved [annettepixie](https://wordpress.org/support/users/annettepixie/)
 * (@annettepixie)
 * [4 years ago](https://wordpress.org/support/topic/escaping-htmlentities/)
 * Hi,
    I’m using 2 radio button merge fields to record consent for privacy and 
   emails – the GDPR Compliance for Mailchimp plugin only provides one checkbox 
   for email consent so I can’t use that.
 * The radio button option ( I convert to checkboxes via javascript ) includes a
   single quote which Mailchimp converts to html entities `& #39;` The form submission
   is failing as the json sent to Mailchimp is escaping it `\\ & #39;`
 * Example of json response:
    `Value must be one of: I agree to my personal data
   being stored by MailChimp and used for the distribution of the XXXs& #39; weekly
   insights newsletter. (not I agree to my personal data being stored by MailChimp
   and used for the distribution of the XXXs\\& #39; weekly insights newsletter.)`
 * Is there anything I can do in a filter to correct this?
 * Also, is there any way to add html to the form before the submit button other
   than javascript?
 * Thanks
    -  This topic was modified 4 years ago by [annettepixie](https://wordpress.org/support/users/annettepixie/).

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

 *  [jpowersdev](https://wordpress.org/support/users/jpowersdev/)
 * (@jpowersdev)
 * [4 years ago](https://wordpress.org/support/topic/escaping-htmlentities/#post-15555654)
 * Hi [@annettepixie](https://wordpress.org/support/users/annettepixie/),
 * We have a fairly extensive list of [filters](https://yikesplugins.com/knowledge-base/filters/)
   and [actions](https://yikesplugins.com/knowledge-base/hooks/) that you can hook.
 * That being said, there shouldn’t be a space in `& #39;`. If you find a way to
   get rid of that, it should be correctly treated as a single quote.
 * Let me know if that helps,
    Jon
    -  This reply was modified 4 years ago by [jpowersdev](https://wordpress.org/support/users/jpowersdev/).
      Reason: It was decoding the html entity
 *  Thread Starter [annettepixie](https://wordpress.org/support/users/annettepixie/)
 * (@annettepixie)
 * [4 years ago](https://wordpress.org/support/topic/escaping-htmlentities/#post-15555833)
 * Hi [@jpowersdev](https://wordpress.org/support/users/jpowersdev/)
 * Thanks for the reply – I had to edit my question and put in a space in `& #39;`
   as it was being converted to a single quote `'` even though I’d put it in code
   blocks – there wasn’t a space in the actual json response.
 * For anyone with a similar issue, I used the yikes-mailchimp-filter-before-submission
   filter and htmlentities() on the single quote.

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

The topic ‘Escaping htmlentities’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/yikes-inc-easy-mailchimp-extender_a1c7e5.
   svg)
 * [Easy Forms for Mailchimp](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/)
 * [Active Topics](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [annettepixie](https://wordpress.org/support/users/annettepixie/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/escaping-htmlentities/#post-15555833)
 * Status: resolved