DEV Community

Rahil Khan
Rahil Khan

Posted on

Add LocalBusiness schema to your small business website (copy-paste JSON-LD)

Google already reads your contact page, but it has to guess which text is your phone number, your address and your opening hours. LocalBusiness structured data removes the guessing. It's a short block of JSON-LD in your page's <head>, and it takes about ten minutes.

The snippet

Paste this into the <head> of your homepage (or contact page) and replace every value with your own:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Your Business Name",
  "url": "https://yourbusiness.com",
  "telephone": "+1-555-555-0100",
  "image": "https://yourbusiness.com/storefront.jpg",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "12 Main Street",
    "addressLocality": "Your City",
    "postalCode": "00000",
    "addressCountry": "US"
  },
  "openingHoursSpecification": [{
    "@type": "OpeningHoursSpecification",
    "dayOfWeek": ["Monday","Tuesday","Wednesday","Thursday","Friday"],
    "opens": "09:00",
    "closes": "18:00"
  }]
}
</script>
Enter fullscreen mode Exit fullscreen mode

Tips

  • Use a more specific type if one fits: Restaurant, Dentist, Plumber, HairSalon, AutoRepair and many more are all subtypes of LocalBusiness.
  • Match your Google Business Profile exactly. Same name, same phone format, same address. Mismatches confuse search engines.
  • Only mark up what's visible on the page. If your hours aren't shown to visitors, show them, then mark them up.
  • WordPress? Most SEO plugins have a "Local business" setting that outputs this for you, so check there before pasting code.

Test it

Run the page through Google's Rich Results Test and the Schema Markup Validator. Fix any errors they flag, then request indexing in Search Console.

It won't change how your site looks, but it helps search engines show the right hours, phone and address for your business.


NEXCOD builds fast, search-friendly websites for small businesses: https://nexcod.vercel.app · WhatsApp +1 289 902 5119

Top comments (0)