
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.
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:
- JSON-LD vs Microdata vs RDFa: Which Structured Data Format Should You Use?
- Organization Schema: Logo, sameAs and Contact Details Explained
- Article and BlogPosting Schema: Which Properties Matter?
- Product Schema: Required and Recommended Properties for Online Stores
Request received
Thank you! Saad will contact you within the next 24 hours.
Keep an eye on your phone and inbox.
