Schema output for Local SEO for WordPress

The schema output for Local SEO for WordPress builds upon Yoast SEO for WordPress' base schema output, to add additional local business detail (such as addresses and opening hours).

Core logic

On location archives

  • Construct an itemList which contains all of the LocalBusiness objects represented on the page.
  • Add a mainEntityOfPage property to the itemList which references the ID of the WebPage.

On a single location page

  • Add a LocalBusiness piece for the business in question, unless it already exists in the graph (e.g., on a single location page which represents the same Organization as the one which represents the site).
  • Add a mainEntityOfPage property to the LocalBusiness piece which references the ID of the WebPage.

Additional scenarios

When the site represents a single business, with a single location

  • Extend the Organization piece which represents the site into a LocalBusiness.

When the site represents a single business, with multiple locations

On all pages

  • If the business has a 'main' or 'primary' address, extend the Organization which represents the site into a LocalBusiness, using that address.

On the homepage

  • Add a LocalBusiness piece for each location, and add a branchOf property which references the ID of the main Organization piece.
  • Remove duplicated properties (such as taxID) from the additional LocalBusiness pieces.