SEO Basics

What Is Schema Markup and Why Does Google Care About It

The hidden code that tells search engines what your content really means.

Scroll to start

A Shared Language Between You and Search Engines

Every webpage is full of text that humans can read and understand. But when a search engine like Google reads your page, it has to guess what your words actually mean. Schema markup is a special kind of code you add to your page that tells Google exactly what your content means — in a language it understands perfectly.

Think of it like adding labels to a filing cabinet. Without labels, someone opening a drawer has to read every folder to find what they need. With labels, they go straight to the right spot. Schema markup is those labels — for search engines.

For example, if you write a recipe on your blog, schema markup tells Google: "This is a recipe, it takes 30 minutes, the rating is 4 stars, and here are the ingredients." Google then knows exactly how to show your result — with a rich preview, stars, cook time, and more.

Better Listings, More Clicks

When someone searches on Google, they see a list of results. Most results look the same — a title, a short description, and a URL. But some results stand out: they have star ratings, images, prices, event dates, or answers right in the search results. Those stand-out results almost always use schema markup.

Studies show that rich results — the special search listings with extra information — get more clicks than regular listings. A recipe with a photo and cook time in the search results will almost always beat a plain text listing, even if both pages are equally good.

Schema markup also helps Google understand your content more accurately. If your page is about "apple pie" but you don't use schema, Google might think you're writing about the fruit or the tech company. Schema tells Google: "This is a dessert recipe."

💡 Key Insight

Schema markup doesn't change how your page looks to visitors. It only adds invisible code that helps search engines understand your content better — and when they understand it better, they show it to more of the right people.

Adding Labels in Three Steps

Schema markup uses a standardized vocabulary called Schema.org — a collection of "item types" (like Person, Product, Recipe, Event) and "properties" (like name, price, rating, date). You add this information to your HTML using a format called JSON-LD.

Here's how to add schema to a page:

01

Pick your item type

Go to schema.org and find the type that matches your content — Article, Book, Course, Event, Product, Recipe, and dozens more.

02

Fill in the properties

Each item type has a set of properties. For a Product, that's name, price, brand, and reviews. For an Article, it's headline, author, datePublished, and image.

03

Add the JSON-LD code to your page

Paste the JSON-LD snippet into the <head> section of your HTML. It doesn't show up visually — it's just there for search engines to read.

📝 Common Item Types

  • Article — blog posts, news
  • Product — things for sale
  • Recipe — food and drink
  • Event — concerts, meetups
  • FAQ — Q&A pages
  • LocalBusiness — shops, services

✅ Best Practices

  • Only mark up content that's actually on the page
  • Use the most specific type possible
  • Test with Google's Rich Results Test tool
  • Keep information accurate and up to date
  • Don't add schema for content you don't have

Adding Schema to a Product Page

Imagine you run a small online shop selling handmade candles. Here's how you'd add product schema to your candle product page — using a JSON-LD script tag in the <head> of your HTML:

product.html — head section
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Lavender Soy Candle",
  "description": "Hand-poured soy candle with real lavender essential oil. 40-hour burn time.",
  "brand": {
    "@type": "Brand",
    "name": "Ember & Oak"
  },
  "sku": "EO-LAV-001",
  "offers": {
    "@type": "Offer",
    "price": "24.99",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.8",
    "reviewCount": "124"
  }
}
</script>

Google reads this JSON-LD and now knows: the product name, price, brand, whether it's in stock, and its rating. In search results, your candle listing could show stars, price, and availability — right there on the search page.

Knowledge Check

Test what you learned with this quick quiz.

Quick Quiz — 3 Questions

Question 1
What does schema markup do for your website?
Question 2
What is Schema.org?
Question 3
Which format does Google recommend for adding schema markup to a page?
/* ======================================== QUIZ ENGINE ======================================== */ (function() { var results = {}; var answered = {}; var totalQuestions = document.querySelectorAll('.quiz-block').length; document.querySelectorAll('.quiz-option').forEach(function(btn) { btn.addEventListener('click', function() { var qId = this.getAttribute('data-q'); if (answered[qId]) return; answered[qId] = true; var isCorrect = this.getAttribute('data-correct') === 'true'; var block = this.closest('.quiz-block'); var options = block.querySelectorAll('.quiz-option'); var feedback = document.getElementById(qId + '-feedback'); options.forEach(function(o) { o.disabled = true; }); if (isCorrect) { this.classList.add('correct'); feedback.textContent = '✓ Correct!'; feedback.style.color = 'var(--accent)'; results[qId] = true; } else { this.classList.add('wrong'); options.forEach(function(o) { if (o.getAttribute('data-correct') === 'true') o.classList.add('correct'); }); feedback.textContent = '✗ Not quite — see the highlighted answer.'; feedback.style.color = 'var(--red)'; results[qId] = false; } feedback.style.display = 'block'; }); }); var finishBtn = document.getElementById('finishQuiz'); if (finishBtn) { finishBtn.addEventListener('click', function() { var answeredCount = Object.keys(answered).length; var correctCount = 0; for (var k in results) { if (results[k] === true) correctCount++; } if (answeredCount === 0) { alert('Please answer at least one question first!'); return; } if (correctCount === totalQuestions && answeredCount === totalQuestions) { alert('🏆 Perfect score! You aced this learning module!'); } else { alert('You got ' + correctCount + ' out of ' + totalQuestions + ' correct.'); } }); } })(); /* ======================================== SCROLL ANIMATIONS ======================================== */ (function() { var observer = new IntersectionObserver(function(entries) { entries.forEach(function(entry) { if (entry.isIntersecting) { entry.target.classList.add('visible'); } }); }, { threshold: 0.1 }); document.querySelectorAll('.fade-in').forEach(function(el) { observer.observe(el); }); })(); /* ======================================== ACTIVE NAV TRACKING ======================================== */ (function() { var sections = document.querySelectorAll('section'); var navLinks = document.querySelectorAll('nav .nav-links a'); window.addEventListener('scroll', function() { var current = 'hero'; sections.forEach(function(s) { if (window.scrollY >= s.offsetTop - 200) current = s.getAttribute('id'); }); navLinks.forEach(function(link) { link.classList.toggle('active', link.getAttribute('href') === '#' + current); }); }); })();