Creating Your Own Schema Markup

Published: March 17, 2019  by 
person pointing to the screen of their laptop with these words over the photo: creating your own schema markup

“There’s schema for that” has become the new “there’s an app for that” in the SEO world. As the SEO practice continues to grow, more and more schema markup is being discovered and developed. There’s schema markup for nearly every business type, recipe, reviews, products on ecommerce, your dog. That last one I haven’t seen but give it a few months, I’m sure I’ll see it. To create this markup, people have used schema markup generators to develop markup easily and automated. But what happens when the generators aren’t up to speed with the rest of the schema that’s being developed?

What is Schema Markup?

Schema markup is enhanced language on a page signaling to Google exactly what is on that page. When Google crawls a page, they can make an accurate assumption about what the page is about, given the page is optimized correctly with proper headers, content, and structure. With schema markup in place, Google can get a much better idea of what the page is about. If you have a landscaping business, you can create schema markup that will explain to Google that the page is specifically about your landscaping business, your address, your contact information, business hours, and geographic location. With schema markup implemented onto your site, your site becomes more readable to search engines and enhances your visibility online.

What Kind of Markup Do You Use?

There’s two forms of schema markup that appear the most on schema generators, JSON-LD and Microdata. But which one do you choose? According to Google’s standards, they greatly recommend JSON-LD over Microdata as explained here. JSON-LD is also easier to read and build as the markup is built with widely popular syntax, JavaScript. A coding language that Google also uses to crawl and index sites.

Where to Start When Creating Schema Markup

One of my favorite tools to create schema markup is, Merkle. With their generator tool, you’re able to easily create schema markup for almost anything. They do a great job lining out what you need to enter for the markup to work, and the tool compiles it for you. When you’re done, Merkle provides the link to Google’s Schema Testing Tool for you to validate the markup yourself.

Missing Markup

But what happens when you can’t find schema markup for your business on schema generator sites? Then it’s time to create your own using a competitor analysis and Google’s Schema Testing Tool.

For an example, let’s create schema markup for real estate listings. Although there doesn’t appear to be a schema generator for house listings, we can make our own just by looking at what other sites are doing. When we visit popular real estate sites like Trulia or Zillow, we can view their source code and find their schema markup for houses. What we’re looking for in this case is “SingleFamilyResidence” as it describes the house.

example of schema markup on a website

Pulling the Schema Markup

After we find the page with the schema markup we need, we can enter the page’s URL in Google’s Structured Data Testing Tool. Google does a great job detecting every instance of schema that’s on the page and breaks it down into categories. Google’s tool breaks the page into two columns: The left column displays the source code from the page we are testing, and the right column displays all of the schema markup that Google has detected on the page, such as organization, product, and “SingleFamilyResidence”, which is what we are looking for.

After clicking on “SingleFamilyResidence” on the detected page, we’ll see a list of “SingleFamilyResidences” which represent each house on the listing page. Click on one of them and we’ll have the schema markup we need to create our own markup.

Schema Markup Structure

To create this schema, we don’t need to build it from total scratch; instead, we can edit markup that already exists. A great template I used when creating the real estate schema was Whitespark’s “JSON-LD Markup Guide to Local business Schema.” I choose the local business schema because both the local business and real estate schema require a “PostalAddress” @Type.

example of schema markup structure on a website

To create the markup, you can copy and paste the local business schema to a blank notepad, a program found on most computers. If you don’t have access to a notepad, Google’s Structured Data Testing Tool can be used instead.

What to Replace and Add in the Markup

There are only a few functions and elements that need to be changed for the local business schema to be converted to real estate schema.

First, you’ll replace the @Type “LocalBusiness” with type “@SingleFamilyResidence” and add the address for the house for sale under the @Type “PostalAddress”. Next, you’ll remove the description, name, telephone, and opening hours as they pertain to the local business schema. You’ll want to keep the geo portion in as it gives the listing a more concise location as to where it is. You can find the geographic coordinates for the house by searching the address in Google Maps, and in the URL will be the latitude and longitude. With these two fields correctly in place, you now have the schema markup that Zillow or Trulia has on their listing pages.

If you want to take it a step further, you can add more to the schema. For this example, you can add the listing price with the type, “@offer”, or that the house has a pool with “@accomodation” – “amenityFeature”.

To learn more about available schema, visit does a great job staying up to date with schema properties.

When you’ve finalized your schema and you’re ready to add it to your site, test it through Google’s Structured Data Testing Tool as a snippet of code just to make sure you don’t have any warnings or errors.

Where Do I Place the Schema When It’s Ready?

This seems to be the most popular question when it comes to schema. Some say you can place the schema in the <body> section of the page and then some people say you can add the schema in the <head> section because it’s the markup in JavaScript. I’ve also heard that schema should be wrapped around the copy on the page. The markup is all wrapped in a script tag, which means it won’t be displayed on the webpage but will be accessible to search crawlers. If I’m working with a WordPress site, I prefer installing the plugin, Header and Footer Script. With this plugin activated, you’ll be able to add unique schema markup to whichever page you want the markup to be on.

Can I Add More Than One Form of Schema to a Page?

Of course! The more schema the better.