0
0
SEO Fundamentalsknowledge~30 mins

Structured data and schema markup in SEO Fundamentals - Mini Project: Build & Apply

Choose your learning style9 modes available
Structured Data and Schema Markup Basics
📖 Scenario: You are creating a simple webpage for a local bakery. You want search engines to understand important details about your bakery, like its name, address, and opening hours, so your site appears better in search results.
🎯 Goal: Build a basic JSON-LD structured data snippet using schema.org vocabulary to describe the bakery's key information.
📋 What You'll Learn
Create a JSON object with bakery details using schema.org vocabulary
Add a context and type to the JSON-LD data
Include bakery name, address, and opening hours
Complete the JSON-LD script tag for embedding in HTML
💡 Why This Matters
🌍 Real World
Structured data helps search engines understand your website content better, improving how your site appears in search results with rich snippets.
💼 Career
SEO specialists and web developers use schema markup to boost website visibility and user engagement by enhancing search listings.
Progress0 / 4 steps
1
Create the bakery information object
Create a variable called bakery_info that is a dictionary with these exact entries: "name": "Sweet Treats Bakery", "address": "123 Cookie Lane, Candy City", and "openingHours": "Mo-Fr 08:00-18:00".
SEO Fundamentals
Need a hint?

Use a dictionary with keys exactly as "name", "address", and "openingHours".

2
Add JSON-LD context and type
Create a variable called structured_data that is a dictionary containing "@context" set to "https://schema.org" and "@type" set to "Bakery". Also include all entries from bakery_info inside this dictionary.
SEO Fundamentals
Need a hint?

Use keys "@context" and "@type" exactly, and copy values from bakery_info.

3
Convert structured data to JSON string
Import the json module and create a variable called json_ld by converting structured_data to a JSON string using json.dumps().
SEO Fundamentals
Need a hint?

Use import json and json.dumps() to convert the dictionary to a JSON string.

4
Create the final JSON-LD script tag
Create a variable called script_tag that is a string containing a <script> tag with type="application/ld+json" and the JSON-LD data inside it using the json_ld variable.
SEO Fundamentals
Need a hint?

Use an f-string to embed json_ld inside the script tag string.