---
title: Psst! Got Unparsable Structured Data?
permalink: /futureproof/unparsable-structured-data/
description: I was wrestling with structured data errors on my blog reported by Google Search Console (GSC). I'd added Schema.org markup using both HTML attributes and JSON-LD, but kept getting unparsable structured data errors in Google Search Console, specifically bad escape sequence in string. Turns out, my `articleBody` content in the JSON-LD was causing the issue due to unescaped characters. To fix it, I simply removed the `articleBody` from the JSON-LD, relying on the HTML markup, which is more forgiving. I also realized I could use my existing article summary as the `abstract` field, simplifying things even further.
meta_description: Fix JSON-LD structured data errors by removing problematic content and relying on HTML schema markup for error-free SEO.
meta_keywords: JSON-LD, structured data, Schema.org, escape error, unparsable data, Google Search Console, SEO troubleshooting, HTML markup, Jekyll, articleBody fix
layout: post
sort_order: 4
---
{% raw %}
## Making the Unparsable Parsable!
Got Unparsable Structured Data? Yeah, me too! Starting out with this blog, which
I create all with plain old text-files, written in markdown and thrown onto a
GitHub repo for the Jekyll SGG (static site generator) to kick-in and transform
into these nifty web pages, I realized how easy it was to just toss in the
Schema.org itemscope, itemtype and itemprop's on the HTML elements, ***plus the
JSON+LD in a `
```
**Understanding the Problem: Escaping Issues in JSON-LD**
The core issue I faced was how my `articleBody` content was being inserted into the JSON-LD script. JSON-LD, being JSON, has strict rules about string formatting. My `content` variable from the Jekyll SGG liquid template system, which represents the article body, contained characters that needed escaping (like quotation marks, backslashes, or newline characters), and those characters weren't properly escaped, it would lead to parsing errors.
**What I Did and Why It Worked**
I removed the `articleBody` from the JSON-LD script:
```javascript
// Before (Problematic):
"articleBody": "{{ content | number_of_words }}"
// After (Working):
// Removed "articleBody" entirely
```
By removing it, I eliminated the source of the unescaped characters, and the JSON-LD became valid.
**The Distinction Between HTML Schema.org Markup and JSON-LD**
Remember the distinction between the HTML elements with `itemscope` and the `
```
**Why Keeping `articleBody` in HTML Still Works**
Even though I removed `articleBody` from the JSON-LD, it still works in the HTML because the HTML parser is more forgiving with character escaping. Search engines can still extract the structured data from the HTML attributes.
**Code Snippets and Explanation**
* **Example of Escaping Issues:**
Imagine your `content` variable contains the following:
```
This is an article with "quotes" and \backslashes\.
```
If you directly insert this into the JSON-LD without escaping, it would look like this:
```javascript
"articleBody": "This is an article with "quotes" and \backslashes\."
```
This would cause a parsing error because the quotation marks and backslashes need to be escaped:
```javascript
"articleBody": "This is an article with \"quotes\" and \\backslashes\\."
```
* **Correcting the Issue (If You Wanted to Keep `articleBody` in JSON-LD):**
To fix this, you would need to ensure that your templating engine (Jekyll my your case) properly escapes the `content` variable before inserting it into the JSON-LD. Jekyll has filters that can help with this. For example, you might use the `jsonify` filter, or write a custom filter to properly escape the string.
```javascript
"articleBody": "{{ content | jsonify }}"
```
...but I tried every friggin variation I could think of. And I don't really
control it. It's all this Jekyll default stuff in GitHub, and attempts to
override their defaults with a `_config.yml` file. Ugh! I don't need the
headache. So I decided to rely on the HTML schema redundancy, and just tore the
big ol' block of article text out of the JavaScript, and so far, so good!
The important point being here that of redundancy between the two different
structured data approaches, and if on of them is getting errors reported because
of complex encoding problems because you're trying to shove a huge blob of text
in there, maybe don't.
And as an extra bonus, I just realized that in my Jekyll `post.html` template
where I construct that article-blurb summary blockquote at the top of these
articles, I can just use that in the `abstract` field for a [Schema.org
Article](https://schema.org/Article).
So, I removed this:
```html
"articleBody": "{{ content | strip_html | xml_escape | normalize_whitespace | strip_newlines | json_escape }}"
```
...and I added this:
```html
"abstract": "{{ page.description | default: page.excerpt | strip_html | strip_newlines }}"
```
---
## Update: Parsing error: Missing ',' or '}'
I have another unparsable structured data problem that I just tackled: Bad escape sequence in string. Again, easy peasy. And I just made the fix yesterday, and overnight it processed 12 of the 14 pages I made the fix to:

Unparsable structured data > Bad escape sequence in string > Validation details
Validation Looking good!
The proof is in the putting... curly-braces where they belong to close a JavaScript JSON-LD attribute value.
And that's no joke.
---
## AI's Take on The Article
Alright, let's get this done!
[Description moved to top]
**Title and Headline Ideas:**
1. **Titles:**
* "Taming Unparsable Structured Data: My JSON-LD Adventure"
* "Schema.org Snafus: How I Solved My Parsing Errors"
* "JSON-LD vs. HTML Markup: A Structured Data Showdown"
* "Structured Data Simplified: Fixing JSON-LD Escape Issues"
2. **Headlines:**
* "Unparsable Data? Here's the Quick Fix!"
* "Decoding JSON-LD Errors: My Journey to Valid Structured Data"
* "Stop the Parsing Panic: Mastering Schema.org Markup"
* "Why Your JSON-LD is Breaking (and How to Fix It)"
**My Opinion:**
I found the author's experience quite relatable. Debugging structured data can be a real headache, especially when dealing with complex content and templating systems. The author's practical approach—simply removing the problematic element and relying on redundancy—demonstrates a pragmatic problem-solving mindset. The clarity in explaining the difference between HTML markup and JSON-LD, along with the code examples, makes the article valuable for anyone struggling with similar issues. It's a good example of how sometimes, simpler is better.
{% endraw %}