Adding Local business schema to your locations

With organic search, there are several reasons why having a proper and thorough schema applied to your website is an advantage. Schema helps search crawlers do their job more effectively by helping them comprehend a landing page and delivering relevant information on the search engine results page.

Terms to know

Schema - Schema is a shared language created by search engines, containing a standard markup for structured data search engines are able to understand.

Structured data - Where Schema is the language in which you present your content, structured data is the actual data you provide.

Rich results - By providing structured data using Schema, search engines will know exactly what users can find on your page and what it all means.

Rich results with Local business schema 

When users search for businesses on Google Search or Maps, Search results may display a prominent Google knowledge panel with details about a business that matched the query. When users query for a type of business (for example, "best NYC restaurants"), they may see a carousel of businesses related to the query. With Local Business structured data, you can tell Google about your business hours, different departments within a business, reviews for your business, and more.

You can find out more from Google about structured data for local businesses

Adding Local business schema to your theme

To add the schema to your theme, copy and paste the following code and place it at the bottom of your locations template. 

Validate your code using the Rich Results Test.

You can also customize the code below to add other properties, your custom fields, and change the type of location. You can find the full definitions at

{% comment %}
Local Business Schema
Use custom fields to add your own data. e.g priceRange, acceptsReservations, sameas.
{% endcomment %}
<script type="application/ld+json">
   "@context": "",
   "@type": "LocalBusiness",
   {% if location.image_url %}
   "image": "{{location.image_url}}",
   {% endif %}
   "name": "{{}}",
   "address": {
     "@type": "PostalAddress",
     {% if location.address_line_1 %}"streetAddress": "{{location.address_line_1}}{% if location.address_line_2 %}, {{location.address_line_2}}{% endif %}",{% endif %}
     {% if %}"addressLocality": "{{}}",{% endif %}
     {% if %}"addressRegion": "{{}}",{% endif %}
     {% if location.postal_zip_code %}"postalCode": "{{location.postal_zip_code}}",{% endif %}
     {% if %}"addressCountry": "{{}}"{% endif %}
   "geo": {
     "@type": "GeoCoordinates",
     "latitude": {{}},
     "longitude": {{location.lng}}
   "url": "{{location.url}}"
   {% if location.phone_number or or location.opening_hours %},{% endif %}
   {% if location.phone_number %}
   "telephone": "{{location.phone_number}}"
   {% if or location.opening_hours %},{% endif %}
   {% endif %}
   {% if %}
   "email": "{{}}"
   {% if location.opening_hours %},{% endif %}
   {% endif %}
  {% if location.opening_hours %}
     "openingHoursSpecification": [
     {% for opening_hour in location.opening_hours %}
       "@type": "OpeningHoursSpecification",
       "dayOfWeek": "{{}}",
       {% if opening_hour.status == "open" %}
       "opens": "{{opening_hour.opening_time | date: "%H:%M"}}",
       "closes": "{{opening_hour.closing_time | date: "%H:%M"}}"
       {% elsif opening_hour.status == "24h" %}
       "opens": "00:00",
       "closes": "23:59"
       {% elsif opening_hour.status == "closed" %}
       "opens": "00:00",
       "closes": "00:00"
       {% endif %}
     {% unless forloop.last %},{% endunless %}
     {% endfor %}
   {% endif %}

Was this page helpful? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Contact