SEO and Metadata Basics

Help search engines and social platforms understand your pages with titles, meta descriptions, structured data and crawlable markup.

Beginner · about 2 hours · difficulty 1/5

Learn first: Semantic and Accessible HTML

Search engine optimisation for developers is mostly about not getting in the way. Good content wins, but broken technical foundations can hide good content completely.

What you control in markup

  • A unique, descriptive <title> and <meta name="description"> per page.
  • One clear <h1> and semantic structure; crawlers use headings and landmarks too.
  • Canonical URLs (<link rel="canonical">) to avoid duplicate-content confusion.
  • Open Graph and Twitter card tags (og:title, og:image) control link previews in chat apps and social feeds.
  • Structured data in JSON-LD (schema.org types like Article, Product, JobPosting) can unlock rich results.
  • Real <a href> links, because crawlers follow hrefs, not click handlers.

Site-level concerns

  • robots.txt and sitemap.xml tell crawlers what to fetch.
  • Fast, mobile-friendly pages rank better; Core Web Vitals are a ranking signal.
  • Client-side rendering risk: if content only appears after JavaScript runs, some crawlers and most link-preview bots will see an empty page. This is one of the main reasons server rendering and static generation exist.

Good enough to move on

Your pages have correct titles, descriptions, social previews that render when you paste the link into a chat app, and a sitemap. Deeper SEO (keyword research, link building) is marketing work, not a frontend prerequisite.

Key concepts

  • Title and meta description
  • Canonical URLs
  • Open Graph and social cards
  • Structured data (JSON-LD)
  • robots.txt and sitemaps
  • Crawlability of client-rendered pages

Mini project

Add complete metadata, Open Graph tags, a JSON-LD Person or Article block and a sitemap to your profile page, then verify the social preview and run Google's Rich Results Test.

Check yourself

Why might a purely client-rendered page show an empty preview when its link is shared?

Free resources