SEO · fix guide

How to add and fix structured data (LocalBusiness schema)

Structured data tells search engines and AI assistants exactly what your business is, where it is and when it's open. Here's a working example, the common errors, and how to validate it.

Published Updated By Remidiy

Short answer: add one block of LocalBusiness JSON-LD to your homepage. Use the most specific type that fits (Plumber, Dentist, Restaurant…) and include your name, full address, phone, website, opening hours (openingHoursSpecification) and a sameAs list of your Google Business Profile and social profiles.

Then paste the page into Google's Rich Results Test and the Schema.org validator. One syntax error makes Google ignore the whole block, so validate every time you edit it.

Structured data is a short, machine-readable description of your business placed in the page's code, using the shared Schema.org vocabulary. Visitors don't see it. Search engines and AI assistants read it to confirm facts such as what you are, where you are and when you're open. Google supports three formats and recommends JSON-LD, a block of data inside a <script type="application/ld+json"> tag, because it sits apart from the visible HTML and is easiest to maintain (Google: intro to structured data).

The page has no structured data

Minor Shown in the checker's Search (SEO) tab as “No business markup”.

The checker flags this when the homepage's HTML has no application/ld+json script at all. It doesn't count microdata or RDFa, and it reads the HTML before JavaScript runs. Google can read JSON-LD that's injected by JavaScript (Google: structured data with JavaScript), but many other crawlers can't.

Why it matters

LocalBusiness markup states your business details in a form Google can use for its local business features, and AI assistants can quote it with confidence. To be eligible for Google's local business features, name and address are required. Phone, URL, hours, coordinates and price range are recommended (Google: LocalBusiness structured data). Markup makes you eligible; it doesn't guarantee a rich result.

How to fix it

Put a block like this in the page's <head> (the end of the <body> also works), replacing every value with your own:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Plumber",
  "name": "Smith Plumbing",
  "url": "https://www.example.com/",
  "telephone": "+1-914-555-0142",
  "image": "https://www.example.com/img/storefront.jpg",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "100 Main St",
    "addressLocality": "Yonkers",
    "addressRegion": "NY",
    "postalCode": "10701",
    "addressCountry": "US"
  },
  "openingHoursSpecification": [
    {
      "@type": "OpeningHoursSpecification",
      "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
      "opens": "08:00",
      "closes": "17:00"
    },
    {
      "@type": "OpeningHoursSpecification",
      "dayOfWeek": "Saturday",
      "opens": "09:00",
      "closes": "13:00"
    }
  ],
  "sameAs": [
    "https://maps.app.goo.gl/your-business-profile-link",
    "https://www.facebook.com/your-page",
    "https://www.instagram.com/your-account"
  ]
}
</script>

Pick the most specific type from the Schema.org LocalBusiness list, as Google advises: Plumber, Electrician, HairSalon, Dentist, Restaurant, AutoRepair and so on. Use plain LocalBusiness only if nothing fits. Mark up only what the page also shows visitors, because Google's guidelines don't allow structured data describing content that isn't visible to users (Google: structured data guidelines).

WordPress

Most SEO plugins output basic Organization or WebSite markup once you fill in the business details in their settings. Their local-business options vary, and some put them in a separate add-on. Alternatively, paste the block above with a plugin that adds code to the site's header, or into a child theme.

Wix, Squarespace and Shopify

Wix lets you add custom structured data in a page's advanced SEO settings. Squarespace offers header code injection on plans that include it. On Shopify, the block goes in the theme's theme.liquid file, inside <head>. Check what the platform or theme already outputs first, so you don't end up with two conflicting business blocks.

How to check it's fixed

Test the live URL in Google's Rich Results Test, which shows the local business item it detected and any errors, and in the Schema Markup Validator, which checks it against the full Schema.org vocabulary. Then run the checker again.

The structured data has a syntax error

Fix soon Shown in the checker's Search (SEO) tab as “1 of 2 structured-data blocks won't parse”.

The checker tries to read each application/ld+json block as JSON and counts those that fail.

Why it matters

JSON is strict (json.org), and a block that won't parse is thrown away whole, so the business details, hours or reviews it described count for nothing. Broken markup is common on hand-edited sites, because the mistakes are invisible on the page.

How to fix it

Paste the code into the Schema Markup Validator or Rich Results Test, which point at the line with the error. The usual causes:

  • A comma after the last item in a list or object ("closes": "17:00", followed by }).
  • Curly “smart” quotes instead of straight " quotes, usually from pasting via a word processor or a visual editor.
  • An unescaped double quote inside a value: write \", or rephrase.
  • Comments (// or /* */), which JSON doesn't allow.
  • Two objects placed one after another without wrapping them in [ … ] or an @graph list.
  • A CMS or optimisation plugin turning quotes into HTML entities such as &quot;. Add the block in raw HTML or code mode, and exclude it from minification if that's the cause.

How to check it's fixed

Both validators should report no syntax errors, and the checker's finding disappears.

The business markup has no opening hours

Minor Shown in the checker's Contact & trust tab as “Business schema has no opening hours”.

The checker found a business-type node in your structured data (for example LocalBusiness, Store, Restaurant or Plumber) with neither openingHoursSpecification nor openingHours.

Why it matters

“Are they open now?” is one of the most common things people ask about a local business. Hours in your markup give search engines and assistants a direct answer from your own site.

How to fix it

Add an openingHoursSpecification list like the one in the example above, with one entry per group of days that share the same hours, using 24-hour times (Schema.org: OpeningHoursSpecification). Google's documentation covers the special cases: for open 24 hours, use "opens": "00:00" and "closes": "23:59"; for closed all day, set both to "00:00"; and hours past midnight can close at, say, "03:00". Keep the hours identical to those on the page and on your Google Business Profile (see the Google Business Profile checklist). If you're appointment-only or a service-area business without public hours, leave them out rather than inventing some.

The business markup has no sameAs links

Minor Shown in the checker's AI search tab as “Organization schema has no sameAs links”.

The checker found an Organization or business-type node (such as LocalBusiness, ProfessionalService, Store, Restaurant or HairSalon) with no sameAs property.

Why it matters

sameAs lists other pages about the same business: your Google Business Profile, Facebook, Instagram, LinkedIn, Yelp or an industry directory (Schema.org: sameAs). Google's Organization documentation describes it as the place for your profile pages on social media or review sites (Google: Organization structured data). The links help search engines and AI systems connect your website with your listings elsewhere and treat them as one business, which matters most when your name is shared with other businesses.

How to fix it

Add a sameAs list of full URLs, as in the example above. For your Google Business Profile, find the business on Google Maps, choose Share and copy the link. Only include profiles you control that represent this exact business, and remove ones you've abandoned. A dead profile is worse than none. Then retest with the Rich Results Test and run the checker again. More on how AI tools use these signals is in AI search visibility.

Sources

Common questions

What is schema markup for a local business?

It is a block of JSON-LD code using the Schema.org LocalBusiness vocabulary that states your business name, address, phone, hours and profiles in a machine-readable form. Visitors don't see it; search engines and AI assistants read it.

Is JSON-LD better than microdata?

Google supports JSON-LD, microdata and RDFa equally when valid, but recommends JSON-LD because it sits in one block apart from the visible HTML and is easier to maintain. It is also what the checker looks for.

Does structured data improve rankings?

Google presents structured data as a way to help it understand a page and to make the page eligible for richer search features, not as a ranking boost it promises. Accurate business details that search engines and AI tools can read are still worth having.

How do I test my schema markup?

Paste the URL or code into Google's Rich Results Test to see what Google detects, and into the Schema Markup Validator for a full vocabulary check. Fix every error before publishing.

Should I add LocalBusiness schema to every page?

Usually the homepage, or the contact or location page, is enough for a single-location business. Businesses with several locations should give each location its own page with its own LocalBusiness block and address.

Check your markup. The website checker reads every structured-data block on your homepage, reports any that won't parse, and checks for hours and profile links, alongside titles, security and speed. Remidiy sets up and maintains business schema as part of our local SEO service; get in touch if you'd like it done for you.

Explore Remidiy