Write Schema Without Schema Markup Generator

Schema markup generators won't write the entire code for you. They just help you to add the basic tags (4-5 features) for your schema. Let's see how we can write schema by implementing all applicable tags.  

Using Schema.org you can find the markup you need for your particular page. For instance, if you want to write structured data code for your organization, the schema is available at schema.org/Organization

As we already discussed, Structured data is a system of pairing a name with a value that helps search engines categorize and index your content.

In the table (image) content under Property is the name and Expected type is the value. We are using JSON-LD for writing codes.  Keep your eyes peeled for these 4 rules to write schema on your own.

✒️Rule 1:

In JSON-LD format, codes will be written inside script tag which is not visible for users. These codes will be shown in page source only which are readable for search engines.

Example:

<script type="application/ld+json">
{
-----
-----
-----
  }
</script>

✒️Rule 2:

name:value pair is written as "name": "value" and each line of code ends with a comma (,) except <script> tag line and the last line of the code before </script> tag.

Example:

<script type="application/ld+json">
      {
        "@context": "https://schema.org",
        "@type": "Organization",
        "name": "Neoito",
        "award": "ISO 9001:2015 certified",
        "foundingDate": "2014",
        "url": "https://www.neoito.com",
        "knowsAbout": "Web and mobile app development",
        "legalName": "Neoito Technologies Pvt Ltd",
        "numberOfEmployees": "40",
        ------
        ------
        ------
        "hasPOS": "Worldwide"      
      }
    </script>

The code is tested using structured data testing tool.

✒️Rule 3:

A schema with property inherited from other is written as  {then define type …..}.

Example:

The properties of address is inherited from another schema PostalAddress and is defined inside  { "@type" : "PostalAddress"........}.

<script type="application/ld+json">
      {
        "@context": "https://schema.org",
        "@type": "Organization",
        "name": "ABC Corp",
        "address": 
          {
            "@type": "PostalAddress",
            "addressLocality": "Palayam, Thiruvananthapuram",
            "addressRegion": "Kerala",
            "addressCountry": "IN",
            "postalCode": "695033",
            "streetAddress": "3rd Floor, Chandrasekharan Nair Stadium"
          }
          }
          </script>

✒️Rule 4:

Multiple same category items are grouped with in [ ].

Example:

 "sameAs": [
            "https://www.facebook.com/xyz",
            "https://www.linkedin.com/in/xyz/",
            "https://twitter.com/xyz"
          ]

Let's look into another example of listing company address.

"address": 
        {
          "@type": "PostalAddress",
          "addressLocality": "Palayam, Thiruvananthapuram",
          "addressRegion": "Kerala",
          "addressCountry": "IN",
          "postalCode": "695033",
          "streetAddress": "3rd Floor, Chandrasekharan Nair Stadium"
        },

Here's a situation in which you want to list address of 2 office locations in Organization schema.

It's easy to do so!!! Simply use [] according to our Rule: 4.

"address": [
          {
            "@type": "PostalAddress",
            "addressLocality": "Palayam, Thiruvananthapuram",
            "addressRegion": "Kerala",
            "addressCountry": "IN",
            "postalCode": "695033",
            "streetAddress": "3rd Floor, Chandrasekharan Nair Stadium"
          },
          {
            "@type": "PostalAddress",
            "addressLocality": "Ingos gate 9",
            "addressRegion": "OSLO",
            "addressCountry": "NO",
            "postalCode": "695033"
          }
        ],

That's it.  Use these rules to write the schema 🙌

Commonly used Structured Data

  1. Website
  2. Organization
  3. Social Profiles
  4. Postal Address
  5. Search Action

Useful tool: Google structured data testing tool to validate the schema code. This testing tool is moving to Google's rich results test tool.

Have any questions? 🤔 shoot. 😎

Subscribe to newsletter
Need more tech news? Tune in to our weekly newsletter to get the latest updates