SEO

What is JSON-LD and why is it preferred?

JSON-LD is a block of JSON inside a script tag describing what a page is about. Google recommends it over Microdata and RDFa because it sits apart from the visible markup, so a design change cannot silently break it.

Answered by Anas Bin Masud 154 words 3 sections

Why format choice matters

Microdata is woven through the HTML as attributes. When someone restructures a template, the markup breaks and nobody notices because nothing looks different. JSON-LD is self-contained, reviewable and far more durable.

Getting the shape right

  • One script tag containing one @graph array
  • Every node given an @id, so others can reference it
  • References written as bare { "@id": "..." } objects
  • Absolute URLs matching your canonical exactly
  • Validated with both the Schema Markup Validator and the Rich Results Test

Range errors validators forgive

email must be Text — a mailto: prefix makes consumers emit mailto:mailto:. primaryImageOfPage accepts only ImageObject. telephone should be E.164 everywhere. dateModified must reflect content, not the deploy.

The longer version

This answer is deliberately short. If you want the full treatment, Schema markup that does something, and the kind that risks a penalty covers it in about 3 minutes — free, ungated, written from client work.

Who answered this

Anas Bin Masud builds e-commerce sites and does technical SEO for businesses in the UK, Canada and Pakistan — fifteen live client sites, six of them stores taking real payments. These answers come from those projects rather than from a content brief. More about how I work, or ask me something directly.

People also ask

All 110 answers →

Still have a question this did not answer?

Send the brief and you get a reply within one business day — either questions, or a scoping call. If your project is not something I should take on, I will say so then.

Response
Replies within 1 business day
Hours
Mon–Fri, 09:00–18:00 PKT — overlaps 05:00–14:00 UK, 00:00–09:00 US Eastern
Booking
Booking projects from October 2026
WhatsApp — opens a chat with +92 346 5348466 in a new tab