Skip to content
Digital Agency AwardFounded 2021, the specialist awards body for digital agencies

Guide · Search

Schema Markup Basics: Help Google Read Your Pages

By the editorial team, Digital Agency Award,

Schema markup is a set of labels you add to a page so that search engines can read it more clearly. This guide covers what it is, the formats, the types a small business site can use, Google's rules and how to test your code.

  1. What schema markup is

    Schema markup is extra code on a web page that says what the page is about. A person can look at a page and see a shop address, a phone number and opening hours. A search engine only sees text. Schema markup labels each piece so the machine knows which is which.

    Google calls the general idea structured data. In its words, it is a standard format for giving information about a page and sorting the page content. Google says it uses this data to understand the page. It also uses it to power some special search results, such as recipe cards with photos and ratings.

    The labels come from a shared word list at schema.org. Google, Bing and Yahoo! announced that project on June 2, 2011, so that site owners would not have to learn a different format for each search engine. The vocabulary is free to use.

    Sources: Google Search Central, Understand how structured data works; Google Search Central Blog, Introducing schema.org (June 2, 2011); Schema.org, About

  2. The three ways to write it

    You can write schema markup in three formats: JSON-LD, Microdata and RDFa. Google says JSON-LD is the one it recommends.

    JSON-LD sits in one block of code, usually in the head of the page. It does not touch the visible text. That makes it easier to add, check and fix. A short block for a business might say that the page is about an Organization, then give its name and web address.

    Microdata works differently. You add small attributes to the HTML tags around the text itself, such as itemscope and itemprop. It works, but the labels get tangled with the layout. If a designer changes the page, the labels can break by accident.

    If you are starting fresh, pick JSON-LD. If your site builder already adds Microdata, you do not need to rip it out.

    Sources: Google Search Central, General structured data guidelines; Schema.org, Getting started

  3. Which types suit a small business site

    Schema.org lists many types. A small business site needs only a few.

    • Organization names your company, its web address and its logo.
    • LocalBusiness adds a street address, opening hours and a phone number. It suits shops, clinics and studios with a place people can visit.
    • Article marks a blog post or news item with its headline, author and date.
    • Product describes an item for sale, with its name, image and price.

    Google has a guide for LocalBusiness. It says the data can feed the knowledge panel that shows details about a business when someone searches for it. That panel is a box beside the results with your hours and address.

    Start with the type that matches your home page. Add others only where the page really is about that thing. A page about your opening hours is a good place for LocalBusiness. A price list is not a Product page unless it lists real products.

    Sources: Google Search Central, Local Business structured data; Schema.org, About

  4. Rules that keep you out of trouble

    Google has plain rules for structured data. Follow them, because a break can stop your markup from showing and may even cause a manual action against the page.

    • Mark up only what a visitor can see on the page. Do not label hidden text, even if it is true.
    • Keep the data true and current. Google says it will not show a rich result for time-sensitive content that is no longer relevant.
    • Do not mark up fake reviews or anything that does not fit the page.
    • Do not block pages that carry markup with robots.txt or a noindex tag.
    • Fill in every required property for the type you use.

    There is one more point to know. Google says correct markup does not guarantee a special result. Markup makes a feature possible. Google still decides what each searcher sees.

    Also note a date change. Since April 6, 2020, Google no longer counts data-vocabulary.org markup for rich results. If an older site still uses it, it should move to schema.org.

    Sources: Google Search Central, Understand how structured data works; Google Search Central, General structured data guidelines; Google Search Central Blog, Sunsetting data-vocabulary.org (January 21, 2020)

  5. How to test your markup

    Test the code before you publish it, and again after. Two free tools matter in May 2021.

    The first is the Rich Results Test from Google. You paste in a page address or a block of code. It shows which special search features the markup can support, and it lists errors and warnings. Google says to use it while you build the page.

    The second is the Schema Markup Validator at validator.schema.org. In December 2020 Google said it would refocus the old Structured Data Testing Tool and move it to a schema.org site by April 2021. The new tool checks that your markup follows schema.org. It does not check for Google rich results.

    So use the Rich Results Test when you want to know about Google features. Use the Validator when you want to check plain schema.org syntax.

    After the page goes live, check the rich result reports in Search Console. Google warns that templates and server settings can break markup after launch.

    Sources: Google Rich Results Test; Schema Markup Validator; Google Search Central Blog, An update on the Structured Data Testing Tool (December 15, 2020); Google Search Central, Understand how structured data works

  6. A simple plan for your site

    1. List your key pages: home, contact, a few services and your latest posts.
    2. Pick one type per page that matches what the page truly shows.
    3. Write the markup in JSON-LD, using only facts that are visible on the page.
    4. Run each page through the Rich Results Test and fix every error.
    5. Publish, then watch Search Console for new warnings.

    Keep your expectations modest. Schema markup does not fix thin pages or slow sites. It gives search engines clearer facts about a page that is already good. Treat it as a tidy finish, not a trick.

    Sources: Google Search Central, Understand how structured data works; Google Search Central, General structured data guidelines

  7. Sources

    1. Google Search Central, Understand how structured data works
    2. Google Search Central, General structured data guidelines
    3. Google Search Central, Local Business structured data
    4. Google Search Central Blog, Introducing schema.org (June 2, 2011)
    5. Google Search Central Blog, An update on the Structured Data Testing Tool (December 15, 2020)
    6. Google Search Central Blog, Sunsetting data-vocabulary.org (January 21, 2020)
    7. Schema.org, About
    8. Schema.org, Getting started
    9. Google Rich Results Test
    10. Schema Markup Validator

All guides · News · Methodology