How to add JSON-LD schema markup to any Wix page using Custom Code

Module 6: Technical SEO, Structured Data & Rich Snippets for Wix | Lesson 66 of 683 | 50 min read

By Michael Andrews, Wix SEO Expert UK

This is the most technically important lesson in the entire course. Every structured data type covered in subsequent lessons relies on this foundation: how to add JSON-LD code to your Wix site using the Custom Code feature. Master this process once, and you can implement any schema type on any page of your Wix site. This lesson covers the step-by-step process, site-wide vs page-specific deployment, common errors and fixes, advanced techniques like nesting multiple schema types, and a troubleshooting guide for when things go wrong.

How-to diagram showing technical SEO elements including JSON-LD structured data markup, schema types, site speed optimisation, and rich snippet results in Google
Technical SEO and structured data transform how Google displays your Wix site in search results with rich snippets and enhanced listings.

Finding Custom Code in Wix

Navigate to Custom Code in Wix

Site-Wide vs Page-Specific Schema

Understanding when to use site-wide vs page-specific deployment is critical. Using the wrong scope wastes schema potential or creates errors.

Adding Your First JSON-LD Block

Step-by-step: adding schema to Wix

The JSON-LD Template Structure

<!-- Basic structure -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Your Business Name",
  "url": "https://www.yourdomain.com"
}
</script>

<!-- With nested objects -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Your Business",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Your Street",
    "addressLocality": "Your City",
    "postalCode": "AB1 2CD"
  }
}
</script>

<!-- With arrays -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Your Business",
  "sameAs": [
    "https://facebook.com/yourbusiness",
    "https://linkedin.com/company/yourbusiness",
    "https://twitter.com/yourbusiness"
  ]
}
</script>

Combining Multiple Schema Types on One Page

Many pages benefit from multiple schema types. A service page might have Organization schema (site-wide) plus FAQPage schema (page-specific) plus BreadcrumbList schema (page-specific). You have two options for combining:

Option 1: Separate Script Blocks (Recommended)

Add each schema type as a separate <script> block. This is cleaner, easier to maintain, and easier to debug. Each block is independent.

Option 2: @graph Array

Combine multiple schema types in a single <script> block using the @graph property. This is more advanced but creates explicit relationships between entities.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "name": "Your Business"
    },
    {
      "@type": "FAQPage",
      "mainEntity": [
        {
          "@type": "Question",
          "name": "Your question?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Your answer."
          }
        }
      ]
    }
  ]
}
</script>

Troubleshooting Common Errors

Syntax Errors

Rich Results Test Errors

Schema Not Appearing After Publishing

Debugging missing schema

Schema Management Best Practices for Wix

Using Schema Generators vs Writing Code Manually

Final Checkpoint: Every schema snippet should pass the Rich Results Test with zero errors before publishing. After publishing, verify the live URL passes the test. Check Google Search Console Enhancements within a week to confirm Google has detected your schema. If errors appear, fix the code and republish immediately.

Two clean ways to add it

There are two clean ways to add JSON-LD to a Wix site, and it is worth being deliberate about which you use so you do not end up with the same schema twice. The first is the site wide Custom Code area, under Settings and then Custom Code, where you paste a script into the Head. That is right for anything that belongs on every page, like your Organization or LocalBusiness block. The second is the per page route: the Advanced SEO panel on each page has a Structured Data Markup field, which is the tidy place for markup that only applies to that one page, like an Event or a Product.

The two rules that keep you safe

Whichever route you take, JSON-LD is the format Google prefers, and it always goes inside a script tag with the type set to application slash ld plus json. Two rules keep you out of trouble. Only mark up things that are actually visible on the page, because marking up content a visitor cannot see is against Google's guidelines. And watch for duplication, because Wix already generates some schema for certain page types, so adding your own on top can leave two competing blocks.

The habit that saves you every time is to test after you publish, not before. Run the live URL through Google's Rich Results Test to confirm the markup is valid and eligible, then use URL Inspection in Search Console to check Google can fetch and read it. If something is flagged, the fixes are in <a href="/the-complete-wix-seo-course/lessons/structured-data-errors-warnings-fixing-schema-markup-problems-wix">Fixing schema errors and warnings</a>, and if you want the plain English of what all of this is first, start with <a href="/the-complete-wix-seo-course/lessons/what-is-structured-data-json-ld-microdata-rdfa-wix">What structured data is</a>.

This lesson on How to add JSON-LD schema markup to any Wix page using Custom Code is part of Module 6: Technical SEO, Structured Data & Rich Snippets for Wix in The Most Comprehensive Complete Wix SEO Course in the World (2026 Edition). Created by Michael Andrews, the UK's No.1 Wix SEO Expert with 14 years of hands-on experience, 800+ completed Wix SEO projects and 456+ verified five-star reviews.

Related