seoder

What structured data does, and how it breaks

A JSON-LD block that fails to parse is not partially understood. It is discarded whole, and nothing on the page tells you. That is the whole reason checking the markup is a separate job from writing it.

What the markup is for

Structured data is a description of the page written for machines. A recipe page says it is a Recipe and names the cook time. A product page says it is a Product and gives the price and whether it is in stock. Search engines use that description to decide whether the listing can carry stars, a price, an image or a set of questions, which is the difference between one line of blue text and a result that takes up half the screen.

Checking a page means counting the JSON-LD script blocks in the HTML a crawler receives, seeing how many of them parse as valid JSON, and listing the types found. Parsing is the part worth watching, for the reason above.

How markup breaks

Almost always in the template rather than in the schema. The JSON is assembled by joining strings, a product title contains an apostrophe or a quotation mark, and the result is a syntax error on exactly the pages where the title is interesting. Build the object in your language and serialize it. Every serializer escapes correctly, and the class of bug disappears.

The second failure is a mismatch between the markup and the page. Markup that claims a review score no visitor can see, or a price that differs from the one on screen, is treated as spam rather than as a mistake, and a manual action can cost you every rich result on the site. Anything the markup asserts has to be visible on the page. Cloaking covers where that line sits and the setups that cross it without meaning to.

The third is scope. One page, one main entity. A product listing page that emits fifty Product blocks is describing something it is not, since the page is a list rather than a product. A Breadcrumb block plus a page type is usually all a template needs.

Read the head tags at the same time

The canonical URL, the Open Graph and Twitter tags and the hreflang links fail together with the markup. A template that lost its JSON-LD in a refactor usually lost the canonical tag in the same commit, and a page whose canonical names a different URL hands your markup to that other address. The canonical URL entry explains how the hint is interpreted.

A count of zero on a page you know has markup is a signal by itself, and the usual reason is that the markup is injected by a script and the crawler was reading the raw HTML. Confirm that against the rendering comparison. If the page is returning a success status while having no real content behind it, the markup is the smaller problem, and soft 404s describes the larger one.

Checking a real template

Check a template rather than one hand-tuned page. Most markup problems come from the template, so any product page will show them. Run the HTML a crawler receives through a JSON parser, and do it on the unrendered response, because that is what tells you whether a crawler that skips rendering gets anything at all.

Which crawlers skip it is on the crawler pages, and how a crawler resolves a page covers which pass reads the markup.

Common questions

Does structured data improve rankings?

Not by itself. It decides whether a page is eligible for a rich result, which changes how the listing looks and how many people click it. Eligibility is not a guarantee either, since the search engine still chooses.

What makes a JSON-LD block fail to parse?

The script tag holds something that is not valid JSON. A trailing comma, a raw newline inside a string, or an unescaped quote from a product title are the usual causes, and all three come from building the JSON by string concatenation.

Can I inject structured data with JavaScript?

Google will see it on its rendering pass. Crawlers that do not render never will. If the markup matters, put it in the HTML the server sends.

Do I need microdata or RDFa as well?

No. JSON-LD is the format Google recommends, and it keeps the markup out of your templates. Mixing formats on one page mostly creates two copies to keep in sync.