Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 6.7 — SEO Basics for Developers
HTML · Example 1 of 2

An SEO check of the head

This is a tiny version of what SEO crawlers (and Hectal's own check:seo script) do for every page.

Search engines crawl, render and index pages before they rank them; developers control that with robots rules, canonical URLs, sitemaps, clean URLs, semantic HTML and hreflang for other languages.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 6 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write a robots.txt for a shop that blocks /cart/ and /checkout/ for every crawler and points to its sitemap at https://bagbazaar.example/sitemap.xml.

02

Write the head tags for the French version of https://bagbazaar.example/fr/sacs on a site with English (/en/bags) and French pages, with English as the fallback.

03

Write a JavaScript snippet that logs every <a> on the page that has no href.

Explain it without notes

01

Describe crawling, rendering and indexing, and what can stop each one.

02

What's the difference between robots.txt and <meta name="robots" content="noindex">?

03

What is a canonical URL and when do you need one?

04

How does hreflang work, and what are its common mistakes?

05

Why is semantic HTML part of SEO?

An SEO check of the head

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

robots: index, follow, max-image-preview:large
Indexable: true
canonical: https://ashaskitchen.example/en/pancakes
hreflang: [ 'en', 'hi', 'x-default' ]
hreflang includes this page: true