Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English · Português (Brasil)

Structured-Data-JSON-LD

License: MIT

Free, open source structured data (JSON-LD) template for LocalBusiness/Organization, ready to fill in and paste into your site's <head> inside a <script type="application/ld+json"> tag. It comes with the full structure of a local business, so you only replace the sample values with real ones.

Contents

Background

Writing JSON-LD from scratch is easy to get wrong: a missing required field, addressLocality and addressRegion swapped, an @type with the wrong capitalisation. This file already has the full structure of a local business (name, address, contact, opening hours, service area, offers). You only replace the sample values with your real data.

Usage

  1. Open LocalBusiness.json and replace every placeholder value (YOUR COMPANY NAME, YOURURL.com, CITY, STATE, the sample phone number and so on) with your business's real data.

  2. Paste the content inside a <script> tag in your site's <head>:

    <script type="application/ld+json">
    { ... conteúdo do LocalBusiness.json preenchido ... }
    </script>
  3. Validate the JSON-LD before publishing. Two options:

    • Google's Rich Results Test, run against the published URL.
    • jsonld-graph-check, another tool by the same author. It runs locally without sending any data off your machine, so you can use it before the page is even published.

Fields to check

  • addressLocality is the city; addressRegion is the state. They are often swapped, so check them before publishing.
  • @id comes as https://YOURURL.com/#LocalBusiness. Replace YOURURL.com with your real domain. An @id with the full URL (instead of just #LocalBusiness) avoids ambiguity if the same block is reused on more than one page.
  • telephone shows up in three places (the main telephone, contactPoint and location). Keep the same number and the same format (+CC-DDD-DDD-DDDD) in all three.
  • serviceArea (inside location) uses PostalAddress as its type, with addressLocality and addressRegion for each area served. Add one entry per city or region the business serves, or remove the extra entries if it serves only one area.
  • sameAs should list only real profiles that exist and belong to the business. Do not include empty or third-party social profiles.
  • makesOffer is optional. Remove the whole block if the business does not want to list services here (detailed service listings usually work better as Service on the service page itself, not only in the organisation schema).

FAQ

Is it free? Yes, the template is open source under the MIT license.

Do I need an SEO plugin to use it? No. It works pasted straight into the theme's <head>, through a code insertion plugin, or inside the custom HTML block of any page builder.

Does this JSON replace the schema my SEO plugin already outputs? It depends. If your plugin (Yoast, Rank Math, etc.) already outputs LocalBusiness, pasting this template as well can duplicate the data. In that case, use this file only as a reference to review what the plugin already outputs, instead of publishing both.

Limitations

A generic template for LocalBusiness/Organization. It does not cover other schema types (Product, Article, FAQPage, Review, etc.) and does not validate anything by itself. Validation is manual, with the tools listed above.

Contributing

Bug reports and suggestions are welcome through GitHub Issues.

Author

Lucas Ferraz is an SEO, website development and Generative Engine Optimization specialist and the founder of Lucas Ferraz SEO.

License

MIT. See LICENSE.

About

Structured data for SEO

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors