Title: Bad escape sequence in string
Last modified: May 5, 2026

---

# Bad escape sequence in string

 *  Resolved [gra104](https://wordpress.org/support/users/gra104/)
 * (@gra104)
 * [2 weeks, 4 days ago](https://wordpress.org/support/topic/bad-escape-sequence-in-string-4/)
 * Google Search Console identified a “Bad escape sequence in string” error from
   the script generated by Event Schema. Additionally it says, “items with this 
   issue are invalid. Invalid items are not eligible for Google Search’s rich results.”
 * I’m using Events Manager for my events, and I have a Location that includes a
   single quote, but it is being converted to a &#039; character. Therefore, this
   is appearing in my script:
 * “location”:{“name”:”My Company\&#039;s Name”}
 * instead of like this:
 * “location”:{“name”:”My Company’s Name”}
 * I believe the \&#039; (and maybe the backslash specifically) is causing the error.
   Can you fix that within the plugin? Thanks!

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

 *  Plugin Contributor [Rajat Patel](https://wordpress.org/support/users/rajat1192/)
 * (@rajat1192)
 * [2 weeks, 4 days ago](https://wordpress.org/support/topic/bad-escape-sequence-in-string-4/#post-18899800)
 * Hello [@gra104](https://wordpress.org/support/users/gra104/) ,
 * Thank you for reporting this issue.
 * We’ve reviewed it and implemented a fix. Please copy and replace the code from
   the following file into your setup:
 * **[https://gist.github.com/Rajat1192/50b9635f87e5801dec8d1562f21c5eef](https://gist.github.com/Rajat1192/50b9635f87e5801dec8d1562f21c5eef)**
 * File path: **/event-schema/includes/class-event-schema-common.php**
 * Once you’ve applied the update, please check again. If the issue still persists,
   feel free to contact us via our website, and we’ll be happy to assist you further.
 *  Thread Starter [gra104](https://wordpress.org/support/users/gra104/)
 * (@gra104)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/bad-escape-sequence-in-string-4/#post-18900978)
 * Hi [@rajat1192](https://wordpress.org/support/users/rajat1192/) ,
 * Thanks for the update and quick response. I tested the new code and everything
   seems to now render correctly in the json script. Will you be releasing a new
   version of the plugin with this addition?
 * Thanks again!

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbad-escape-sequence-in-string-4%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/event-schema/assets/icon-256x256.png?rev=3268866)
 * [Event SEO: Event Schema / Structured Data: Google Rich Snippet Schema for Event](https://wordpress.org/plugins/event-schema/)
 * [Support Threads](https://wordpress.org/support/plugin/event-schema/)
 * [Active Topics](https://wordpress.org/support/plugin/event-schema/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-schema/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-schema/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [gra104](https://wordpress.org/support/users/gra104/)
 * Last activity: [2 weeks, 3 days ago](https://wordpress.org/support/topic/bad-escape-sequence-in-string-4/#post-18900978)
 * Status: resolved