How do I add Structured Data to individual Pages?

I am looking at what Google is asking for for structured data on website. Here https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data#markup-formats-and-placement

I want to either adjust the structured data for an individual page or code the files to generate the structured data based on other information on the page.

Is there a way to do this?

Hey @RoncoIndustries

There are lots of SEO APPS that can help you.

if you have a basic understanding how to coding, you can do this yourself refer to
How To Add Structured Data to Shopify for Google Merchant Center

Is there anywhere that explains liquid syntax?

https://shopify.dev/docs/api/liquid

Hope this helps

THANK YOU!

Hi,

The “SA SEO JSON‑LD Schema markup” app allows setting up the structured data and also adding your custom structured data for each page.

Is it secure? A lot of the apps seem a little sketch. Also a bunch of them seem to only affect product pages.

I kinda feel safer just coding each page myself.

Yes, you can do this without any app. Since you want page-specific control, the cleanest way is to target individual pages by their handle inside your page template.

In your theme, open templates/page.liquid (or the page section if your theme uses JSON templates). Shopify gives every page a unique handle based on its URL, so you can add conditional schema like this:

{% if page.handle == 'about-us' %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "AboutPage",
  "name": {{ page.title | json }},
  "url": "{{ shop.url }}{{ page.url }}"
}
</script>
{% endif %}

{% if page.handle == 'contact' %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "ContactPage",
  "name": {{ page.title | json }},
  "url": "{{ shop.url }}{{ page.url }}"
}
</script>
{% endif %}

Each page gets exactly the schema type it should have. Google maps real-world page types to specific schema, so an about page should use AboutPage, a contact page ContactPage, an FAQ page FAQPage, and so on.

If you have a lot of pages and don’t want a long if/else chain, the scalable version is to store the schema type and any custom fields as page metafields under Settings, Custom data, then read them dynamically:

{% assign schema_type = page.metafields.custom.schema_type %}
{% if schema_type %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "{{ schema_type }}",
  "name": {{ page.title | json }},
  "url": "{{ shop.url }}{{ page.url }}"
}
</script>
{% endif %}

That way you set the type per page from the admin without touching code again. Always wrap text values in the json filter like {{ page.title | json }} so any apostrophes or quotes don’t break the markup, then run the URL through Google’s Rich Results Test to confirm it parses.

Since you prefer coding it yourself, this keeps everything in your theme with no third party dependency.