Skip to content

How to Add Local Business Schema to WordPress with or Without a Plugin

How to Add Local Business Schema to WordPress with or Without a Plugin

Local business schema is structured data that tells search engines your business name, address, phone number and opening hours. You can add it to WordPress with Rank Math, with Yoast SEO and its Local SEO add-on, or with a short JSON-LD snippet.

We tested Rank Math and the snippet on a WordPress 7.1.3 test site in October 2026 and checked the output in the Schema Markup Validator. We took the Yoast menu paths from Yoast’s own help pages, because we did not install Yoast.

This guide covers what Google wants, each method step by step, how to test the result, and the mistakes that cause duplicate markup.

What Is Local Business Schema?

Local business schema is markup that describes a physical business with the LocalBusiness type from Schema.org. It lists facts such as the name, address, phone number and hours in a format search engines read. Google says local business schema markup can feed knowledge panels and business carousels in Search.

The LocalBusiness schema type has many subtypes, such as Bakery, Restaurant or Dentist. You pick the one that fits, and the markup then says “this is a bakery” and not just “this is a business”. Our test bakery, Maple Street Bakery, is made up for this guide.

Search engines read the markup in one of several formats, and JSON-LD is the one used in every example on Google’s LocalBusiness page. That is why the snippet method below uses JSON-LD too.

Which Properties Does Local Business Schema Need?

Google requires two properties for local business schema: name and address. It lists more as recommended, including telephone, url, geo, openingHoursSpecification and priceRange. Any schema for local business sites should fill in every property you can back up with facts that are visible on your site.

Local business schema properties that Google requires and recommends

Here is what each property holds for our test bakery:

PropertyWhat you enterExample
nameThe business name as customers see itMaple Street Bakery
addressA PostalAddress with street, city, state, postal code and country123 Maple Street, Springfield, IL
telephoneThe main phone number with the country code+1-217-555-0142
urlThe address of the page for this businessThe home page
geoLatitude and longitude of the location39.799, -89.644
openingHoursSpecificationDays, opening time and closing timeMonday to Friday from 07:00 to 17:00
priceRangeA short price band$$

Google also lists aggregateRating and review. It says those apply only to sites that capture reviews of other local businesses. A bakery should skip them on its own site.

One rule from Google’s structured data policies matters here: do not mark up content that is not visible to readers of the page. So if your markup lists opening hours, your contact page or footer should show the same hours.

How to Add Local Business Schema to WordPress with Rank Math

Rank Math can add local business schema from a settings screen, and the Local SEO module is in the free plugin. You turn the module on, pick your business type, fill in the details and save. On our test site the result was a Bakery entity in the page source.

Rank Math lists Multiple Locations as a Pro feature in the same settings screen. The free steps below fit a business with one location. We used Rank Math 1.0.279, the copy installed on our test site.

  1. Turn on the module: Open Rank Math SEO > Dashboard and switch on the Local SEO module.
    Rank Math Local SEO module switched on
  2. Open the Local SEO tab: Go to Rank Math SEO > Titles & Meta > Local SEO. Choose Organization next to Person or Company and fill in the name, URL and email.
  3. Add the address and business type: Fill in the street, locality, region, postal code and country code. Then pick your business type from the list, which was Bakery in our test.
    Rank Math Local SEO address fields and business type
  4. Add hours, phone and price range: Enter opening hours as 24 hour ranges such as 07:00-17:00. Add the phone number with its country code, set the price range, and enter geo coordinates if you have them.
    Rank Math Local SEO opening hours, phone number and price range
  5. Save and check the source: Save your changes, open your home page, and view the page source. Search for the script tag of type JSON-LD and look for your business type.

Here is the business entity Rank Math wrote on our test site, trimmed to the properties from Google’s list:

{
  "@type": "Bakery",
  "name": "Maple Street Bakery",
  "url": "http://cafe.test",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Maple Street",
    "addressLocality": "Springfield",
    "addressRegion": "IL",
    "postalCode": "62701",
    "addressCountry": "US"
  },
  "priceRange": "$$",
  "openingHours": ["Mo,Tu,We,Th,Fr 07:00-17:00", "Sa 08:00-14:00"],
  "telephone": "+1-217-555-0142"
}

Rank Math put the geo coordinates in a separate Place entity that the business points to. It also wrote the hours in the openingHours text format. Google lists openingHoursSpecification as its recommended property. That is one reason to read the next method.

Rank Math’s own Local SEO guide lists the same fields we filled in. It adds an About page and a Contact page that you can link to the business.

Rank Math also gives you a shortcode that prints the same details on a page, which helps with Google’s visible content rule. When we ran the [rank_math_contact_info] shortcode on the test site, it printed the name, description, email, address, hours and phone number. Place it on your contact page, and the markup and the page then say the same thing.

How to Add Local Business Schema with Yoast SEO

Yoast SEO adds Organization markup for free, but local business details need its separate Local SEO plugin. The free part lives in Yoast SEO, Settings, Site representation. The Local SEO plugin adds its own Local SEO screen under Yoast SEO.

We did not install Yoast on our test site. These paths come from Yoast’s help pages, which we read in October 2026.

In the free plugin, open Yoast SEO > Settings > Site representation. Yoast’s help page says to choose Organization for a local business and add the organization name, a logo and your social profiles.

With the Local SEO plugin active, go to Yoast SEO > Local SEO. Yoast’s Local SEO configuration guide lists the business type, price range, area served and location coordinates. It also says opening hours are set in the Local SEO settings.

For several locations, the same guide says to turn on the multiple locations toggle. That creates a Locations post type. It also says to set a primary location so the plugin can output the right site-wide LocalBusiness markup.

How to Add Local Business Schema Without a Plugin

You can add local business schema without a plugin by printing one JSON-LD script in the page head. A short piece of PHP builds the data, encodes it with wp_json_encode, and prints it only on the page you choose. This method gives you openingHoursSpecification, which Rank Math did not write.

Put the code in a small plugin file or in your child theme’s functions.php. Do not edit a parent theme, because an update erases the change.

We ran it as a must-use plugin on our test site, and a child theme works the same way. A plugin file also needs an opening PHP tag and a plugin name comment at the top.

add_action( 'wp_head', function () {
	if ( ! is_front_page() ) {
		return;
	}

	$hours = array(
		array( array( 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday' ), '07:00', '17:00' ),
		array( array( 'Saturday' ), '08:00', '14:00' ),
	);

	$opening = array();
	foreach ( $hours as $h ) {
		$opening[] = array(
			'@type'     => 'OpeningHoursSpecification',
			'dayOfWeek' => $h[0],
			'opens'     => $h[1],
			'closes'    => $h[2],
		);
	}

	$schema = array(
		'@context'                  => 'https://schema.org',
		'@type'                     => 'Bakery',
		'@id'                       => home_url( '/#localbusiness' ),
		'name'                      => 'Maple Street Bakery',
		'url'                       => home_url( '/' ),
		'telephone'                 => '+1-217-555-0142',
		'priceRange'                => '$$',
		'address'                   => array(
			'@type'           => 'PostalAddress',
			'streetAddress'   => '123 Maple Street',
			'addressLocality' => 'Springfield',
			'addressRegion'   => 'IL',
			'postalCode'      => '62701',
			'addressCountry'  => 'US',
		),
		'geo'                       => array(
			'@type'     => 'GeoCoordinates',
			'latitude'  => 39.799,
			'longitude' => -89.644,
		),
		'openingHoursSpecification' => $opening,
	);

	echo '<script type="application/ld+json">' . wp_json_encode( $schema, JSON_UNESCAPED_SLASHES | JSON_HEX_TAG ) . "</script>\n";
} );

Change every value to your own business before you save the file. The JSON_HEX_TAG flag turns angle brackets in a value into safe codes. A stray character then cannot close the script early.

The code prints on the front page only. Change the is_front_page() check to match the page that shows your address and hours. Google asks that the markup reflect what the page shows.

With this code active, the page source held one script with the Bakery type. Our test of the output is in the next section.

How to Test Local Business Schema

Test local business schema in the Schema Markup Validator, which accepts a page address or a pasted code snippet. Paste your JSON-LD, run the test, and read the error and warning counts. Our snippet and the Rank Math output both came back with 0 errors and 0 warnings.

Google’s LocalBusiness page also names the Rich Results Test and the URL Inspection tool in Search Console. We did not run the Rich Results Test, because it asked for a Google account sign-in in our test. The Schema Markup Validator checks that the markup is valid, and Google’s tools tell you what Google can use.

After a fix, test again and then check the live page. If your site is public, Search Console can show how Google reads the page. Our guide to submitting your website to Google Search shows how to set that up.

Which Local Business Schema Method Should You Choose?

Choose Rank Math if you already use it and have one location. Choose Yoast with Local SEO if your site runs Yoast, and the snippet if you want full control. Pick only one source, because two at once give search engines two competing records for one business.

Rank Math, Yoast SEO and JSON-LD snippet compared for local business schema

Rank Math is the quickest route on our test site, and it needs no code. The snippet is the only route that wrote openingHoursSpecification, and it costs nothing, but you edit code whenever the hours change.

For a site with many locations, plan the setup before you start. The plugin paths above handle locations in different ways, and the snippet needs one block for each location page.

How Do You Update Local Business Schema When Your Hours Change?

Update your local business schema in the same place you created it and then test the page again. With a plugin you change the hours in its settings screen. With the snippet you edit the hours array in the code and nothing else.

Either way, change the visible hours on your site at the same time.

On our test site we removed the Sunday row in Rank Math’s Local SEO tab and saved. The page source then listed only Monday to Friday and Saturday. Nothing else needed a change, because the markup is built from the saved settings each time the page loads.

For Yoast, the Local SEO configuration guide says opening hours are set in the Local SEO settings. For the snippet, edit the $hours array and keep the 24 hour times.

Hours that change for holidays are easy to forget. Decide who owns the update, and put the same dates on your contact page so the page and the markup stay together.

What Should You Check Before You Publish Local Business Schema?

Check that every value in your local business schema markup matches your site, your phone line and your opening hours today. Then confirm that only one source prints it and that the validator shows no errors. This takes about five minutes and catches most problems before Google reads the page.

  • Name and address: Copy them from your contact page. The markup and the page then agree letter for letter.
  • Phone number: Include the country code, and call the number once to be sure it rings.
  • Opening hours: Compare each day against the hours shown on your site, including days you are closed.
  • Business type: Use the most specific subtype that fits. Our test used Bakery and the validator accepted it.
  • One source: Count the JSON-LD scripts in your page source. From a terminal, curl -s with your address piped to grep -c with the JSON-LD script type counts the lines that hold one.
  • Validator result: Paste the code into the Schema Markup Validator and look for 0 errors.

On our test site that count was one with only Rank Math active, and two once the snippet ran too.

What Mistakes Break Local Business Schema?

Most problems come from running two sources at once, marking up details the page does not show, or leaving sample values in place. Each one is easy to check in the page source. We hit the first one on purpose in our test.

  • Two sources at once: We ran the plugin and our snippet together. The page then had two Bakery entities with different IDs, one ending in #organization and one in #localbusiness.
  • Markup the page does not show: Google’s structured data policies say not to mark up content that is not visible to readers. Put the address and hours on the page and then mark them up.
  • Your own reviews: Google lists review markup only for sites that capture reviews of other local businesses. Leave your own reviews out.
  • Missing name or address: Google requires both. A record without them gives search engines little to use.
  • Sample values left in: Copying the snippet without changing the phone number sends wrong details to search engines.

If you use schema markup in WordPress for other pages, the same rule applies: one source per page. Our guide to adding meta tags in WordPress covers the other head tags that your SEO plugin controls.

Conclusion

Local business schema is a short record of your business that search engines can read. Rank Math’s free Local SEO module, Yoast SEO with its Local SEO add-on, and a JSON-LD snippet can all produce it. Pick one, fill in the required name and address, and test the output.

Keep the markup in step with your site. When your hours or phone number change, change them in one place and check the result again.

If you want help with local SEO and structured data, our WordPress SEO services team can set it up and test it.

Frequently Asked Questions (FAQs)

Q1. Can I add local business schema to my website without a plugin?

Yes. Print one JSON-LD script in the page head with a short PHP function, as shown above. Our snippet passed the Schema Markup Validator with 0 errors and 0 warnings.

Q2. Does Rank Math add local business schema for free?

Yes, for one location. The Local SEO module is in the free plugin, and Titles & Meta then shows a Local SEO tab. Rank Math lists Multiple Locations as a Pro feature in the same screen.

Q3. Does the free Yoast SEO plugin add local business schema?

The free plugin adds Organization details under Site representation. Yoast’s help pages place the business type, price range and opening hours in the separate Local SEO plugin.

Q4. Which business type should I choose?

Pick the most specific LocalBusiness subtype that fits, such as Bakery. Our test used Bakery, and both Rank Math and the Schema Markup Validator accepted it. Use LocalBusiness itself only if no subtype fits.

Q5. How do I add schema for more than one location?

Rank Math lists Multiple Locations as a Pro feature, and Yoast’s Local SEO plugin uses a Locations post type. With a snippet, add one JSON-LD block to the page for each location.

Q6. Can I mark up my own customer reviews?

Not for Google’s local business results. Google lists aggregateRating and review only for sites that capture reviews of other local businesses. Leave your own reviews out of the markup.

Yash Kapoor
Yash Kapoor

Yash Kapoor is the founder and WordPress expert at DevDiggers, where he builds WordPress and WooCommerce plugins for loyalty programs, point-of-sale systems, digital wallets and affiliate management. He writes about developer tools, site performance and the technical side of running a WordPress store. He draws on years of building and maintaining production plugin codebases.

Leave a Reply

Your email address will not be published. Required fields are marked *