Full answer
Search engines read the HTML, follow links and try to understand the page. The front end can help with these items:
- A unique
<title>for each page that describes the page, and a uniquemeta name="description"that can be used as the snippet. Neither is a direct ranking promise, but both affect how the result looks and whether people click. - One
<link rel="canonical">with an absolute URL, pointing to the preferred address of the content. It handles duplicates caused by query strings or alternative paths. - A single clear
h1and an ordered heading outline. Use real headings and links (<a href>), because adivwith a click handler cannot be followed. - The correct status code. A missing page must return 404, not a 200 page that says "not found". This is a server or framework setting, and single-page apps often get it wrong.
meta name="robots"or anX-Robots-Tagheader only for pages that must not be indexed. A mistakennoindexon production is a classic launch bug.- Open Graph and Twitter Card tags control the preview when the link is shared.
- Structured data in JSON-LD, which describes the page with the schema.org vocabulary, for example
CourseorArticle. It is written in ascript type="application/ld+json"block and must match the visible content. - Fast, stable pages. Core Web Vitals are part of the page experience signals, and a page that loads slowly can lose visitors whatever its ranking.
Rendering matters. Crawlers can run JavaScript, but rendering is queued and can be incomplete. Put the title, canonical link, main text and structured data in the server HTML or in the static HTML, and not only in code that runs after load.
The snippet is a head with these parts. The test parses it in Chrome and checks that the JSON-LD is valid, the canonical URL is absolute and there is one h1. Google's Rich Results Test was not run, so validate real pages with it.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Intro to Algebra: free online course | Schoolabe</title>
<meta name="description" content="A beginner course on algebra with short lessons, practice questions and a final quiz.">
<link rel="canonical" href="https://schoolabe.com/courses/intro-to-algebra">
<meta property="og:title" content="Intro to Algebra">
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Course",
"name": "Intro to Algebra",
"description": "A beginner course on algebra.",
"provider": { "@type": "Organization", "name": "Schoolabe", "url": "https://schoolabe.com" } }
</script>
</head>
<body>
<h1>Intro to Algebra</h1>
<a href="/courses">All courses</a>
</body>
</html>Run in headless Chrome 156 through Playwright. Two full runs gave the same results. Checked in headless Chrome: the JSON-LD parses, the canonical URL is absolute and there is one h1. Rich result validation by a search engine was not run.
Key points
- Unique title and description for each page, in the server HTML.
- One absolute canonical URL, and real links and headings.
- Return the right status code, and use noindex only on purpose.
- JSON-LD must be valid and match the visible content.
- Do not depend on late JavaScript for the important tags.
Common mistakes
- Setting the title and meta tags only in client code that runs after load.
- Returning 200 for a not-found page.
- Using the same title and description on every page.
- Adding structured data for content that is not on the page.
Follow-ups
- How does a canonical link differ from a redirect?
- How would you test what a crawler sees?
- What does noindex do compared with a robots.txt disallow?
Tips
- Group the items into content, URL, status and structured data.
- Tie each item to what the server must send.