SEO & Marketing

Schema markup and rich results in Google

Prepare your website for Google rich results with Schema Markup and JSON-LD. Learn the most common types, ready-to-use code, and how to test for accuracy in this guide.

SEO & Marketing

What is Schema Markup and Why Does It Matter for SEO?

Schema Markup is a type of structured data that helps search engines understand your page content more accurately. When Google recognizes that a piece of content is an article, product, FAQ, or event, it can display it in a richer format in search results—for example, with rating stars, images, prices, or FAQ sections. These rich results noticeably increase click-through rate (CTR) because they provide users with more information before they click.

Implementing Schema Markup is one of the technical SEO tasks that has a direct and measurable impact. Unlike many SEO techniques whose results are ambiguous, here you can use Google's tools to see exactly which pages are eligible for rich results and which have errors. In this article, we'll cover the three main formats, focus on JSON-LD (since it's Google's official recommendation), look at some real code examples, and finally review how to test for accuracy.

Different Schema Markup Formats; Which One Should You Choose?

Structured data can be added to a page in three ways. All three are supported by Google, but they have important differences.

JSON-LD (Google's Recommendation)

JSON-LD (JavaScript Object Notation for Linked Data) is a script placed in the <head> or <body> section of a page. Its main advantage is that it's separate from the HTML content—so if the code is wrong, the page's appearance won't break. Google has explicitly stated that it prefers JSON-LD and that it's the simplest way to implement structured data. For WordPress sites, plugins like Rank Math or Yoast SEO automatically generate JSON-LD, but for full control, manual writing is better.

Microdata and RDFa

Microdata and RDFa place data directly inside HTML tags. For example, with Microdata, attributes like itemscope and itemprop are added to existing tags. This method is older, and its advantage is that search engines must read the content to reach the data. But it has many drawbacks: it clutters the code, the risk of human error is high, and if the HTML structure changes, the data breaks too. For new projects, JSON-LD is the more logical choice.

Commonly Used Schema Markup Types for Persian Websites

Not all schema types are suitable for all websites. Below, we review the most commonly used ones based on business type.

Article and BlogPosting for News and Magazine Sites

If you publish articles or news, the Article schema or its subtype BlogPosting introduces it to Google. This data helps Google correctly display the title, featured image, publication date, and author in results. Sample JSON-LD code for an article:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "The Complete Guide to Schema Markup",
  "image": "https://example.com/images/schema-guide.jpg",
  "author": {
    "@type": "Person",
    "name": "Ali Rezaei"
  },
  "publisher": {
    "@type": "Organization",
    "name": "ServerNet",
    "logo": {
      "@type": "ImageObject",
      "url": "https://example.com/logo.png"
    }
  },
  "datePublished": "2024-05-10",
  "dateModified": "2024-05-15",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://example.com/schema-guide"
  }
}
</script>

Important note: The datePublished field must be in ISO 8601 format (e.g., 2024-05-10). If you write the date in Persian or in an invalid format, Google will ignore the entire data.

Product and Offer for Online Stores

For online stores, the Product schema along with Offer (price offer) is the most important. This data allows Google to display price, availability, and product rating in search results. Sample code:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Wireless Headphones Model X200",
  "image": "https://example.com/images/headphone.jpg",
  "description": "Wireless headphones with active noise cancellation and 30 hours of continuous playback",
  "brand": {
    "@type": "Brand",
    "name": "Techno"
  },
  "offers": {
    "@type": "Offer",
    "price": "2450000",
    "priceCurrency": "IRR",
    "availability": "https://schema.org/InStock",
    "url": "https://example.com/product/x200"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.5",
    "reviewCount": "128"
  }
}
</script>

A common mistake: currency unit. If you register the price with IRR (Rial) but write the amount in Toman, Google will display the number incorrectly by ten times. Always align the unit and the amount. Use IRT for Toman.

FAQPage for Frequently Asked Questions

The FAQPage schema allows Google to display your questions and answers in an accordion format in results. This format takes up more space on the search results page and significantly increases CTR. Sample code:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is Schema Markup?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Schema Markup is a type of structured data that helps search engines understand page content more accurately."
      }
    },
    {
      "@type": "Question",
      "name": "Does Schema Markup improve rankings?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Schema does not directly affect rankings, but by improving click-through rate, it indirectly helps SEO."
      }
    }
  ]
}
</script>

Note: Google has stated that if FAQ questions are not visible on the page (e.g., hidden behind tabs), it may ignore the data. The questions must be visibly present on the page.

BreadcrumbList for Navigation Paths

The BreadcrumbList schema shows the page path in search results (e.g., Home > Blog > SEO). This data helps users understand the page's position in the site hierarchy, and Google displays it in results. Sample code:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://example.com"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Blog",
      "item": "https://example.com/blog"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "Schema Markup Guide",
      "item": "https://example.com/blog/schema-guide"
    }
  ]
}
</script>

Organization and LocalBusiness for Brands and Local Businesses

The Organization schema introduces your brand information (name, logo, address, social media) to Google. For physical businesses, the LocalBusiness subtype adds information such as business hours, address, and service area. This data is especially important for local searches like "best coffee shop in Tehran."

Implementing JSON-LD on Your Website; Step by Step

Now that you're familiar with the types, let's go through the implementation steps together.

Step One: Choose the Right Type

Assign only one main type to each page of your site. A product page should not have both Product and Article schema. If a page has multiple types (e.g., an article that introduces a product), choose the main type and add the rest as nested fields.

Step Two: Write the JSON-LD Code

Write the code in a text file and check it with a validation tool. The basic structure is always the same: @context, which points to the schema.org address, and @type, which specifies the data type. The rest of the fields vary depending on the type. To start, use the examples above and replace the fields with your own information.

Step Three: Place the Code on the Page

Place the code inside the <script type="application/ld+json"> tag and put it in the <head> section or at the end of the <body> of the page. If you use a content management system, there's usually a dedicated section for custom scripts. In WordPress, you can use a plugin like Insert Headers and Footers or place the code in the theme file.

Step Four: Test for Accuracy with Google's Tools

Google has two free testing tools:

  • Rich Results Test: Enter the page URL or raw code to see if Google can read the data and what errors exist. This tool is excellent for final checks.
  • URL Inspection Tool in Search Console: After the page is indexed, you can check the status of structured data under the "Enhancements" section. It shows errors and warnings in detail here.

A common mistake: after adding the code, you forget to resubmit the page to Google. Use the URL Inspection tool and click "Request Indexing" so Google re-crawls the page faster.

Common Schema Markup Errors and How to Fix Them

Even experienced developers make mistakes in structured data. A few common ones:

Incomplete Required Fields

Each schema type has required fields. For example, for Product, the name and offers fields are required. If you omit one, Google will ignore the data. The Rich Results Test tool shows exactly which field is missing.

Data Mismatch with Page Content

If you write a price of 100,000 Toman in the schema but the price on the page is 120,000 Toman, Google may treat the data as deceptive content and penalize you. Always align the data with the visible content.

Using Invalid Types

Not all schema.org types are supported by Google. For example, the Event schema is supported for events, but some specific subtypes may be ignored. Before using a type, check Google's rich results documentation to see if it's supported.

Duplicate Code in Multiple Places on the Page

If you place the JSON-LD code both in the template and in the page content, Google will see duplicate data and may ignore one. Only one version of the code should exist on each page.

Final Thoughts; Where to Start?

Schema Markup is one of the few SEO techniques whose results you can see directly in search results. My suggestion is: start with one page. Choose an important product or article page, write the appropriate code, check it with the testing tool, and after ensuring accuracy, extend it to the rest of the pages. Whether your website is hosted on cloud infrastructure or shared hosting doesn't matter; Schema Markup doesn't depend on the server side and can be implemented in any environment. ServerNet, as a hosting service provider, offers suitable infrastructure for running websites based on structured data, but your main focus should be on code accuracy and its alignment with content.

Finally, remember that Schema Markup is not a one-time task. Whenever you add new content or change the page structure, update the structured data as well. By doing this, your website will always be ready for rich results, and Google will display your content in the best possible form.

ServerNet Support

ServerNet engineering & editorial team — specialists in infrastructure, networking and web hosting.

SEO Services
Share:

Comments 0

No comments yet — be the first!

Leave a comment

Related service

SEO Services

SEO is not a cost, it's an investment. With technical SEO, content strategy and principled link building, ServerNet raises your ranking on Google and builds real, lasting organic traffic.