html · level 3 · unit 5 · lesson 1
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
tells search engines what your page is, fact by fact.
A person can tell that a page is about a bakery. A search engine has to guess. removes the guessing: you list the facts in a fixed format, and results can show extras like opening hours and star ratings.
The usual format is JSON-LD, inside . This script never runs and is never shown: it only holds data. JSON is pairs of a and a value, like "name": "Crumbs", inside curly brackets.
"@context": "https://schema.org" says the keys come from Schema.org, a shared list that every big search engine uses. "@type" says what the page describes, like Bakery.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Crumbs Bakery | Fresh bread in York</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Bakery",
"name": "Crumbs Bakery"
}
</script>
</head>
<body><h1>Crumbs Bakery</h1></body>
</html> Press show my page to see it here.
The @ in @context and @type marks them as special keys that set up all the others.
guess first
What will visitors see from this script?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<head>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Restaurant",
"name": "Sunny Side Café",
"servesCuisine": "Breakfast"
}
</script>
</head>
<body>
<h1>Sunny Side Café</h1>
</body>
your turn
Your turn. Describe the shop.
Fill the blanks so search engines know this is a Store called Pip's Plants: the @type on line 9 and the name on line 10.
Press show my page to see it here.
- the type is
Storenot checked yet - the name is Pip's Plantsnot checked yet
- the keys still come from Schema.orgnot checked yet
fix it
Search engines ignore this data. Can you fix it?
Press show my page to see it here.
- the script is marked as JSON-LDnot checked yet
- Search engines only read scripts that are marked as JSON-LD. Look at the
type. - The
typesays plain JSON. It needs theld+jsonending. - Change
type="application/json"totype="application/ld+json"on line 6.
nailed it
search engines know exactly what you are. :D
- Structured data lists facts in a fixed format.
- JSON-LD lives in
<script type="application/ld+json">. @contextand@typecome first, then the facts.
new words in your collection
- structured data
- JSON
- JSON-LD
- key
This lesson isn’t saved. A free account remembers every lesson you finish.