Skip to content

Technical SEO

Where to Place JSON-LD on a Page: Head, Body or Injected by Script?

No pressure and no sales script. Just honest answers.

Prefer Saad Raza SEO on Google Add this site as a preferred source to see more of my SEO and AI search guides in Google Top Stories.

Add saadrazaseo.com as a preferred source on Google

JSON-LD can go in the head or the body of a page, and both are valid. Many sites place it in the head for tidiness. Google can also read JSON-LD that is added by JavaScript after the page loads, though putting it directly in the HTML is the most reliable choice.

Head or body?

Search engines accept either location. The head keeps structured data out of the visible content and is the most common choice. The body is fine if your system makes that easier, for example when a template adds data next to the content it describes.

Adding it with a tag manager or script

Structured data injected by a script can be processed after rendering. It works, but it depends on the script running and being allowed to run, and it can fail if scripts are blocked or slow. Where you can, output it in the page source.

Rather have an expert do this for you?

Hand it over and get back to running your business.

Hand it over to me

Using more than one block

A page can contain several JSON-LD blocks, such as one for the organisation and one for an article. Alternatively, combine items in one block using a graph. Make sure the information is consistent and matches what is visible on the page. If you are still deciding which types to add, start with what schema markup is and which types matter.

Common placement mistakes

  • Putting it on pages where it does not describe the content.
  • Duplicating the same block several times.
  • Leaving old markup in place after a redesign.
  • Marking up content users cannot see.

Test after you publish

Create the code with the schema markup generator, add it to the page and test it. Read what the structured data testing tools are and how to fix structured data errors.

Frequently asked questions

Does location affect rankings?

No. Placement affects reliability, not ranking.

Do I add it to every page?

Only where it accurately describes the page.

Next steps

Read JSON-LD vs Microdata vs RDFa, or contact me here. My on-page SEO services cover titles, snippets and markup like this across a whole site.

More in this series (schema markup questions): start with Free Schema Markup Generator, then explore:

Rather have an expert do this for you?

Tell me about your website and goals, and I will reply with a free first review.

Your details are only used to reply to your request. No spam.

Grow my trafficCall