Guide

How to add LocalBusiness structured data to your website

10 min read

When ChatGPT or Google says your business is closed, has the wrong phone number, or sits in the wrong town, it is usually guessing from messy text on your site. Structured data fixes that. It is a small block of code that states your facts plainly, in a format machines read without guessing. You do not need a developer to add it, and it is one of the few GEO jobs you can finish in an afternoon and check the same day. This guide walks through the exact fields that matter, how to add the block, and how to confirm it works.

What structured data actually is

Structured data is a few lines of code that label your business facts so a machine knows what each one means. A human reading your page can tell that '(555) 200-1180' is a phone number and 'Tue to Sat, 9 to 6' is your hours. A machine reading raw text is not always sure. It has to infer, and inference is where it gets things wrong.

The block you add is called LocalBusiness JSON-LD. JSON-LD is just the format. LocalBusiness is the type, the label that says 'these facts describe a physical business that serves a local area'. Inside that block, each fact gets a clear name: this string is the telephone, this one is the street address, these are the opening hours. There is no guessing left.

You are not writing anything new here. You already have a name, an address, a phone number and a set of hours. Structured data just restates the same facts in a way that leaves no room for a machine to read them wrong.

Why AI and search engines read it

Google has read structured data for years. It is how a search result can show your hours, star rating or phone button without anyone opening your site. The data tells Google those facts directly instead of making it scrape them out of your page layout.

AI assistants work the same way, with higher stakes. When ChatGPT, Gemini or Perplexity answers a question about your business, it pulls facts from whatever sources it can read and trusts the cleanest ones. A page with a labeled LocalBusiness block hands the AI your hours and phone on a plate. A page that buries the address in a footer image forces the AI to guess, and sometimes it guesses an old number or marks you closed.

This connects to the bigger picture in our guide What is GEO (Generative Engine Optimization)? Structured data is one of the inputs AI reads. It will not get you recommended on its own, but it stops the machine from repeating wrong facts about you with full confidence.

The LocalBusiness fields that actually matter

A LocalBusiness block can hold dozens of fields. You do not need most of them. These are the ones that change what an AI or search engine says about you, in rough order of importance:

  • name: your exact business name, spelled the same as on your Google Business Profile and your sign, no extra slogan
  • address: street, city, region and postal code as separate labeled parts, not one run-on string
  • telephone: the number a customer actually reaches you on, in full, including area code
  • openingHours: your real hours per day, the field that decides whether an AI tells customers you are open or closed
  • geo: your latitude and longitude, which pins you to the right spot and stops a same-name business in another town from getting your credit
  • url: your website address, so the data ties back to you and not a directory copy
  • sameAs: links to your other official pages, your Google Business Profile, Facebook, Yelp, Instagram, which tell the AI these profiles are all the same business
  • priceRange: a simple band like $ or $$ or a range like $20 to $60, which helps AI match you to budget-based questions

A ready-to-paste example block

Here is a complete LocalBusiness block. Copy it, then change every value to your own. Keep the field names exactly as they are and only edit the parts in quotes after each colon. The slashes and brackets matter, so do not delete them.

The openingHours format reads as day codes then a time range. Mo, Tu, We, Th, Fr, Sa, Su. So 'Mo-Fr 09:00-17:00' means Monday through Friday, nine to five. Add a second line for different weekend hours. If you close one day, just leave it out. Use the 24-hour clock, so 6pm is 18:00.

For latitude and longitude, open Google Maps, right-click your business pin, and the first row of the menu is the two numbers. The first is latitude, the second is longitude. Paste them in.

  • <script type="application/ld+json">
  • {
  • "@context": "https://schema.org",
  • "@type": "LocalBusiness",
  • "name": "Riverside Auto Repair",
  • "telephone": "+1-555-200-1180",
  • "url": "https://riversideautorepair.com",
  • "priceRange": "$$",
  • "address": {
  • "@type": "PostalAddress",
  • "streetAddress": "412 Mill Street",
  • "addressLocality": "Austin",
  • "addressRegion": "TX",
  • "postalCode": "78702",
  • "addressCountry": "US"
  • },
  • "geo": {
  • "@type": "GeoCoordinates",
  • "latitude": 30.2641,
  • "longitude": -97.7268
  • },
  • "openingHours": ["Mo-Fr 08:00-18:00", "Sa 09:00-14:00"],
  • "sameAs": [
  • "https://www.facebook.com/riversideautorepair",
  • "https://www.yelp.com/biz/riverside-auto-repair-austin"
  • ]
  • }
  • </script>

How to add it without a developer

The cleanest place for the block is the head of your homepage, the part of the page code that holds settings a visitor does not see directly, like the page title. A block in the body works too, since search engines and AI read it either way, but the head is where testing tools look first. You do not have to understand any of this. Most website builders give you a box to drop code into, and that box puts it in a spot that works.

Where that box lives depends on your platform:

  • WordPress: install a free header-and-footer code plugin, or if your theme has a Custom Code or Header Scripts box in its settings, paste it there
  • Squarespace: Settings, then Advanced, then Code Injection, and paste it in the Header box
  • Wix: Settings, then Custom Code, add a new snippet, set it to load on all pages in the head
  • Shopify: Online Store, Themes, Edit code, open theme.liquid, and paste it just before the closing head tag
  • GoDaddy or other builders: look in site settings for a Head, Header Code or Custom Code area

Test it before you trust it

A typo in this block can make it silent or, worse, feed wrong facts. So test it. Google runs a free Rich Results Test, and schema.org points to a free Schema Markup Validator. Both do the same basic thing: you give them your page address or paste the code, and they tell you whether the block is valid and show you exactly which facts they read back.

Read what comes back, not just the pass or fail. If the test shows your phone as the old number, you edited the wrong line. If it shows no LocalBusiness detected, the script tag probably did not save, or it landed outside the head. Fix, save, run it again. It takes two minutes a round.

One honest note. Passing the validator means the code is correct. It does not mean Google or an AI has reread your page yet. Search engines recrawl on their own schedule, usually days to a couple of weeks. So a clean test today is the right first step, not proof that ChatGPT already knows.

Confirm it changed what AI says, by rate not by one answer

This is the step almost every owner skips. They paste the block, see a green check on the validator, and assume the job is done. But the validator only confirms your code is readable. It says nothing about whether ChatGPT, Gemini or Google AI Overviews now state your hours correctly.

To know that, you have to ask the AIs the questions a customer would, like 'what time does Riverside Auto Repair close' or 'is Riverside Auto Repair open on Saturday', and see what they say. The catch is that AI answers vary from run to run. Ask the same question three times and you can get three slightly different replies. So one answer tells you almost nothing. What you want is the rate: across several runs, how often does it now get your hours and phone right? A jump from 'wrong two times out of three' to 'right three times out of three' is the real signal that the fix landed.

Doing this by hand across four AI tools, several runs each, is tedious. This is the part LocalFox does for you. The report asks ChatGPT, Gemini, Perplexity and Google AI Overviews about your business three times each, quotes back what they say word for word, including any wrong hours or prices, and hands you a ready-to-paste LocalBusiness block built from your real details. You can absolutely do all of it yourself with the steps above. LocalFox just runs the loop and shows you the rate in one place.

Common mistakes that quietly break it

Most broken blocks fail for boring reasons, not exotic ones. Watch for these:

  • Facts that do not match your other listings: if your site says 412 Mill Street but Google says 412 Mill St Suite B, the AI sees a conflict and hedges. Pick one exact version everywhere
  • Forgetting to update the block when your hours or number change: stale structured data is worse than none, because it states the wrong fact confidently
  • Pasting the code into a spot that displays it as text instead of running it: use the code or header box your builder provides, not a plain text block
  • Leaving the example values in: a surprising number of sites ship with a sample name or address still in the block
  • Adding the same block on every page with page-specific details that do not fit: for most local owners, one accurate block on the homepage is enough

See what AI says about your business

Run the free check. Your name and city, no account, an answer in about two minutes.

Run the free check

Questions

Will adding LocalBusiness schema make ChatGPT recommend me?+

No, and be wary of anyone who promises that. There is no ad slot inside an AI recommendation. Structured data does one job well: it states your facts so machines read them correctly instead of guessing. That stops AI from repeating wrong hours or a dead phone number about you. Getting recommended depends more on your Google Business Profile and your reviews, which our other guides cover.

Do I really need this if my address is already on my website?+

Having it in plain text on the page already helps a lot, and you should do that first. Structured data adds a layer of certainty on top. Plain text can still be misread, especially if your address sits inside an image or a stylized footer. The labeled block removes the guesswork. If you only have time for one thing, put your name, address, phone and hours in real text on the page; if you have an extra twenty minutes, add the block too.

I changed my hours. Do I have to edit the code every time?+

Yes, the block is a static statement of your facts, so when your hours or phone change you edit the openingHours or telephone line and republish. It takes a minute. The bigger risk is forgetting, because stale structured data confidently feeds the wrong answer. Put it on the same checklist as updating your Google Business Profile so both move together.

How do I know the change actually reached ChatGPT and Google?+

Two separate checks. First, a rich-results checker confirms your code is valid, which you can do the same day. Second, and this is the one people skip, ask the AI tools about your business several times and watch the rate of correct answers, since a single reply varies run to run. Search engines and AI tools recrawl on their own schedule, usually days to a couple of weeks, so give it time before you judge. LocalFox runs that repeated-question check across four AI tools for you if you would rather not do it by hand.

Keep reading