How to Correctly Implement JSON-LD LocalBusiness Schema in HTML
Implementing structured data using JSON-LD (JavaScript Object Notation for Linked Data) is one of the most effective ways to boost local SEO visibility. It allows search engine crawlers to clearly understand key details about a company—such as name, address, phone number, operating hours, and location coordinates—increasing the likelihood of earning rich search snippets and panel placements.
1. Placement: Does JSON-LD Go in <head> or <body>?
According to both Google guidelines and the official W3C standards, JSON-LD <script> blocks can be placed in either the <head> or the <body> section of an HTML document. However, placing structured data within the <head> tag is considered best practice as it guarantees search engine bots process the markup early during page rendering.
2. Why Google Flags "Missing Field" Warnings
Google's Rich Results Test categorizes schema properties as either required or recommended. While missing recommended properties will not completely invalidate your structured data, it will trigger warnings and prevent specific rich snippets from displaying in Search results.
For a robust LocalBusiness implementation, search engines strongly look for:
- @id: A unique, permanent URI anchor (usually the business URL or canonical permalink).
- image: A direct URL to a logo or high-quality photo representing the physical location.
- telephone: A valid contact number, formatted with international country codes.
- url: The official website URL of the location.
- priceRange: Relative cost indicator (e.g.,
"$$"or"$20-$50"). - openingHoursSpecification: Detailed schedule using standardized day and time strings.
- geo: Accurate
GeoCoordinates(latitude and longitude).
3. Use Specific Schema Sub-types
While generic LocalBusiness schema works, Google recommends choosing a more specific subtype whenever possible. For example, use Restaurant, Dentist, Plumber, LegalService, or AutomotiveBusiness to give search engines deeper topical context.
4. Complete & Correct JSON-LD LocalBusiness Example
Here is a fully compliant markup template ready for production deployment: