Schemas

Structured data helps search engines to understand the content of a page. It is important for a website that contains a lot of items such as articles, courses, events, movies, products, recipes, etc. You must want your web pages to be well indexed and has a special appearance on search engines. As a solution, you can put schemas or structured data on every web page that you have.

Schemas or Schema.org enable webmasters to embed structured data on their web pages for use by search engines and other applications. Founded by Google, Microsoft, Yahoo, and Yandex. Here are my tips about schemas or structured data, especially for Google.

  1. Decide the format of your structured data. There are 3 formats; JSON-LD, Microdata, and RDFa. I recommend you to use the JSON-LD format because it's simple. A JavaScript notation embedded in a <script> tag. You can put it inside the <head> tag.
  2. Go to the Google search gallery and then specify your content type. I chose the Article as an example here. I'm assuming that most of you have blogs or decide to have a blog.
  3. AMP or Non-AMP? Here's my article related to Google AMP. The difference is, there are mandatory properties on the AMP page such as author, author.name, datePublished, headline, image, publisher, publisher.logo, publisher.logo.url, and publisher.name.
  4. You can copy the script tag from the example, pick some recommended properties as well as all mandatory properties, then make them dynamic to your content.
  5. Test the structured data of your page on the Google Rich Results Test.

Here is the example script with the JSON-LD format for the AMP page of the Article.

<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "NewsArticle",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://google.com/article"
    },
    "headline": "Article headline",
    "image": [
        "https://example.com/photos/1x1/photo.jpg",
        "https://example.com/photos/4x3/photo.jpg",
        "https://example.com/photos/16x9/photo.jpg"
    ],
    "datePublished": "2015-02-05T08:00:00+08:00",
    "dateModified": "2015-02-05T09:20:00+08:00",
    "author": {
        "@type": "Person",
        "name": "John Doe"
    },
    "publisher": {
        "@type": "Organization",
        "name": "Google",
        "logo": {
            "@type": "ImageObject",
            "url": "https://google.com/logo.jpg"
        }
    }
}
</script>

Here is the example script with the JSON-LD format for the Non-AMP page of the Article.

<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "NewsArticle",
    "headline": "Article headline",
    "image": [
        "https://example.com/photos/1x1/photo.jpg",
        "https://example.com/photos/4x3/photo.jpg",
        "https://example.com/photos/16x9/photo.jpg"
    ],
    "datePublished": "2015-02-05T08:00:00+08:00",
    "dateModified": "2015-02-05T09:20:00+08:00"
}
</script>

Structured data for AMP pages is a must. However, I recommend that you also include it on Non-AMP pages. You will find many properties in the schema documentation. Here's the NewsArticle as an example. You only need mandatory and recommended properties from search engines like Google.

Related Articles