Skip to content

Schema for WordPress

How to add LocalBusiness schema to WordPress

WordPress gives you three places to add LocalBusiness JSON-LD: a header-code plugin, your theme, or a Custom HTML block on the page itself. The plugin route survives theme updates and takes two minutes.

Method 1: paste the code (free)

  1. Generate the markup

    Fill in the LocalSchema builder for your business and copy the script tag from the Code tab.

  2. Install a header-code plugin

    In Plugins → Add New, install a code-snippet plugin that can add code to the site header (for example WPCode or Insert Headers and Footers).

  3. Paste into the header

    Open the plugin's header & footer screen and paste the script into the Header box. Save.

  4. One location page only?

    Instead, edit that page, add a Custom HTML block and paste the script there. JSON-LD in the page body is read just like in <head>.

  5. Test

    Run the page through Google's Rich Results Test or the LocalSchema checker and confirm one LocalBusiness entity is found.

JSON-LD script tag
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Plumber",
  "@id": "https://lonestarplumbing.example/#localbusiness",
  "name": "Lone Star Plumbing Co.",
  "legalName": "Lone Star Plumbing Company LLC",
  "description": "Licensed Austin plumbers for leaks, water heaters, drain cleaning and repiping. Upfront flat-rate pricing and 24/7 emergency service.",
  "slogan": "Fixed right, the first time.",
  "url": "https://lonestarplumbing.example",
  "logo": "https://lonestarplumbing.example/logo.png",
  "image": [
    "https://lonestarplumbing.example/img/van-16x9.jpg",
    "https://lonestarplumbing.example/img/team-1x1.jpg"
  ],
  "foundingDate": "2004-06-15",
  "telephone": "+1 512-555-0144",
  "email": "service@lonestarplumbing.example",
  "priceRange": "$$",
  "currenciesAccepted": "USD",
  "paymentAccepted": "Cash, Credit Card, Check, Financing",
  "knowsLanguage": [
    "English",
    "Spanish"
  ],
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "4810 Burnet Rd, Suite 200",
    "addressLocality": "Austin",
    "addressRegion": "TX",
    "postalCode": "78756",
    "addressCountry": "US"
  },
  "geo": {
    "@type": "GeoCoordinates",
    "latitude": 30.320371,
    "longitude": -97.739614
  },
  "areaServed": [
    {
      "@type": "Place",
      "name": "Austin"
    },
    {
      "@type": "Place",
      "name": "Round Rock"
    },
    {
      "@type": "Place",
      "name": "Cedar Park"
    },
    {
      "@type": "Place",
      "name": "Pflugerville"
    },
    {
      "@type": "Place",
      "name": "Georgetown"
    },
    {
      "@type": "GeoCircle",
      "geoMidpoint": {
        "@type": "GeoCoordinates",
        "latitude": 30.320371,
        "longitude": -97.739614
      },
      "geoRadius": 40000
    }
  ],
  "openingHoursSpecification": [
    {
      "@type": "OpeningHoursSpecification",
      "dayOfWeek": [
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday"
      ],
      "opens": "07:00",
      "closes": "19:00"
    },
    {
      "@type": "OpeningHoursSpecification",
      "dayOfWeek": "Saturday",
      "opens": "08:00",
      "closes": "16:00"
    }
  ],
  "hasOfferCatalog": {
    "@type": "OfferCatalog",
    "name": "Plumbing services",
    "itemListElement": [
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Drain cleaning",
          "description": "Kitchen, bath and main line clearing with camera inspection."
        },
        "priceSpecification": {
          "@type": "PriceSpecification",
          "minPrice": "149.00",
          "priceCurrency": "USD"
        }
      },
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Water heater installation",
          "description": "Tank and tankless installs, haul-away included."
        },
        "priceSpecification": {
          "@type": "PriceSpecification",
          "minPrice": "1400.00",
          "priceCurrency": "USD",
          "maxPrice": "4200.00"
        }
      },
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Leak detection",
          "description": "Non-invasive slab and wall leak location."
        },
        "price": "295.00",
        "priceCurrency": "USD"
      },
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Emergency plumbing",
          "description": "24/7 burst pipe and overflow response."
        },
        "priceSpecification": {
          "@type": "PriceSpecification",
          "minPrice": "189.00",
          "priceCurrency": "USD"
        }
      },
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Whole-home repiping",
          "description": "PEX repipe with drywall patching."
        },
        "priceSpecification": {
          "@type": "PriceSpecification",
          "minPrice": "6500.00",
          "priceCurrency": "USD"
        }
      }
    ]
  },
  "sameAs": [
    "https://maps.app.goo.gl/lonestarplumbing-example",
    "https://www.yelp.com/biz/lone-star-plumbing-co-austin",
    "https://www.facebook.com/lonestarplumbingatx",
    "https://www.bbb.org/us/tx/austin/profile/plumber/lone-star-plumbing-co",
    "https://nextdoor.com/pages/lone-star-plumbing-co-austin-tx"
  ]
}
</script>

Sample for a plumber — generate your own in the builder or on your business type's page.

Method 2: hosted embed (Pro)

Paste one script once. Hours, holiday closures and services you change in LocalSchema reach the site automatically — no more editing WordPress for every update.

  1. Copy the embed script

    In LocalSchema, open the location (or client) → Embed tab and copy the one-line script tag.

  2. Paste it once

    Paste it into the same header-code plugin box. From now on, edit hours and details in LocalSchema — the site updates within a minute.

Hosted embed script
<script src="https://local-schema-beacon.lovable.app/s/loc_yourkey.js" async></script>

Your real key is on the location's Embed tab after you publish it.

Common WordPress pitfalls

  • SEO plugins with local modules (Yoast Local SEO, Rank Math Local, All in One SEO) may already output LocalBusiness markup. Switch theirs off or skip ours — two competing business entities confuse search engines.
  • Page builders such as Elementor and Divi have their own header-code settings; use one place, not several.
  • Caching plugins can keep serving the old page — purge the cache after adding markup.

FAQ