Injecting JSON (Schema) at a Page or Blog Level

OK, I’m looking for suggestions. I want to add custom individual schema at a page or blog level on a per-page basis.

Examples:

  • I’m creating a guide on migrating to Windows 11 and want to include Schema HOW-To markup.
  • I’m writing a post about Shadow AI and want to include Schema FAQ markup.

I have created the FAQ in JSON (schema) that I want get onto the page. I CANNOT add via the WYSIWYG editor as the tags will be stripped out.

Is there a plugin that adds an empty meta field or something at the bottom of the blog or page builder that allows me to insert custom code like JSON? That will then be injected before the closing tag?

I have reviewed multiple Schema plugins, but none seem to fit this ask.

JSON‑LD Express for SEO Schema
Schema App Total Schema Markup
Schema Plus for SEO & JSON‑LD

Any suggestions?

Here’s an example of the markup

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
   {
      "@type": "Question",
      "name": "Who is affected by this change?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Any human user who manages Azure resources, including administrators, developers, and DevOps engineers. Service accounts and managed identities are not affected."
      }
    },
  {
      "@type": "Question",
      "name": "What’s the benefit of enforcing MFA?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "MFA blocks over 99% of account compromise attacks, significantly improving security across Azure environments."
      }
    }
  ]
}
</script>

I think CHAT GPT figured this one out for me…please confirm if this is the correct way to accomplish

Step 1: Create a Metafield for Blog FAQs

  1. In Shopify Admin → Settings → Custom Data → Blog posts.

  2. Click Add definition.

    • Name: FAQ JSON (or something descriptive)

    • Namespace & key: custom.faq_json

    • Content type: Multi-line text (important — this lets you paste JSON code).

  3. Save.

Now every blog post has a field where you can paste its own FAQ JSON.


:wrench: Step 2: Add JSON-LD Output to Your Blog Template

  1. Go to Online Store → Themes → Edit Code.

  2. Open your blog article template (templates/article.liquid, main-article.liquid, or sections/article-template.liquid).

  3. Before the closing </body> (or just inside the article section), add this snippet:

{% if article.metafields.custom.faq_json %}
<script type="application/ld+json">
{{ article.metafields.custom.faq_json | escape }}
</script>
{% endif %}


:wrench: Step 3: Add FAQs Per Post

  1. Edit a blog post in Shopify.

  2. Scroll down to Metafields → FAQ JSON.

  3. Paste your FAQ JSON (without <script> tags, just the raw JSON). Example:

{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is Azure MFA Phase 2?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Azure MFA Phase 2 expands mandatory multi-factor authentication to all Azure management interfaces — including CLI, PowerShell, APIs, SDKs, and automation tools."
      }
    }
  ]
}

Seemed to work except in the source code of the blog post the quotation marks in the markup are transformed to HTML entities

{&quot;@context&quot;:&quot;https://schema.org&quot;,&quot;@type&quot;:&quot;FAQPage&quot;

A bit overcomplicated, IMO.

If your JSON is “static”, then –

Have you tried clicking </> button to switch to HTML entry before pasting your json snippet?

Then, if you need to output data from the Shopify database, you’d need to include some liquid code to reference it in your json, you can always use “Custom liquid” section instead of editing theme code.
(Theme code edits will prevent future theme updates).

Contents of “Custom liquid” sections/blocks are fed through Liquid and then output directly in your page HTML without any other processing.

This is exactly what | escape filter in your liquid code does – try removing it.

And again – you do not need to edit theme code for this – use “Custom liquid” section instead.

your are 100% correct….removing the | escape filter fixed it