Skip to content

Expert · Fast, accessible, findable and safe: quality for real sites · topic 48 of 64 · 30 min

SEO basics: help people find your pages

Explanation

SEO (search engine optimisation) means helping search engines understand your pages so the right people find them. Search engines crawl (visit) pages, index (store and understand) them, and rank them for each search. Good SEO is mostly good work: a clear title and description, one h1 and logical headings, real HTML content, fast mobile pages, and useful text written for people.

Crawl, index, rank

Think of it like this: Think of a huge library. The crawler is a librarian who walks around picking up new books (pages) by following links. Indexing is writing a catalogue card for each book: its title, topic and language. Ranking is the librarian deciding which books to hand you first when you ask a question. Your job is to make your book easy to find, easy to catalogue, and actually worth reading.

Crawlers such as Googlebot follow links from page to page and read your sitemap. The search engine then renders the page and reads its text, title, headings, links and images, and stores what it learns in its index. When someone searches, it ranks pages by many signals: how well the content answers the question, how trustworthy the site is, and page experience (mobile-friendly, fast, HTTPS). Google indexes the mobile version of your site, so the phone layout must have the full content.

The page head

html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Sharma Tiffin Service, Pune: Veg Meal Plans</title>
  <meta name="description" content="Home-style veg lunch and dinner delivered in Kothrud, Pune. Monthly plans from Rs 2,400. Order on WhatsApp.">
  <link rel="canonical" href="https://www.example.com/tiffin/">

  <!-- Open Graph: the preview card on WhatsApp, LinkedIn, Facebook -->
  <meta property="og:title" content="Sharma Tiffin Service, Pune">
  <meta property="og:description" content="Home-style veg meals, monthly plans from Rs 2,400.">
  <meta property="og:image" content="https://www.example.com/tiffin/share.jpg">
  <meta property="og:url" content="https://www.example.com/tiffin/">
  <meta property="og:type" content="website">
</head>
title, description, canonical and Open Graph tags all live in the head
  • title: the blue clickable line in search results and the name on the browser tab. Make it unique for every page, describe that page, and put the important words first. Results show roughly the first 50 to 60 characters.
  • meta description: the grey text under the title. It does not change ranking directly, but a clear one gets more clicks. Search engines may rewrite it. About 150 to 160 characters is shown.
  • canonical: when the same page opens at several URLs (with ?ref=whatsapp, with and without www), it says which URL is the main one, so the copies do not compete.
  • Open Graph (og:) tags control the card people see when they share your link on WhatsApp or LinkedIn. Use a full https URL for og:image.

Headings, links and content

Use one h1 that says what the page is about, then h2 and h3 in order. Write link text that says where it goes: "Download the fee structure (PDF)", not "click here". Give images useful alt text. Above all, write for people: answer the question your visitor really has, in plain words. Search engines have become very good at recognising helpful content, and very good at ignoring tricks.

robots.txt, sitemap.xml and noindex

output
# https://www.example.com/robots.txt
User-agent: *
Disallow: /admin/
Disallow: /cart/

Sitemap: https://www.example.com/sitemap.xml
robots.txt (at the site root) says which paths not to crawl, and where the sitemap is
output
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/</loc>
    <lastmod>2026-10-01</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/menu</loc>
  </url>
</urlset>
sitemap.xml lists the pages you want found. Many frameworks generate it for you.
Careful: robots.txt is not a lock. A blocked page can still appear in results if other sites link to it, and anyone can open robots.txt and read your "hidden" paths. To keep a page out of results, let it be crawled and add <meta name="robots" content="noindex">. Truly private pages need a login.

Structured data with JSON-LD

Structured data is a small block of JSON that describes the page in a shared vocabulary from schema.org: this is a local business, this is a recipe, this is a product with a price. Search engines can use it to show richer results, such as opening hours or star ratings, but it does not guarantee them.

html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Sharma Tiffin Service",
  "address": {
    "@type": "PostalAddress",
    "addressLocality": "Pune",
    "postalCode": "411038",
    "addressCountry": "IN"
  },
  "openingHours": "Mo-Sa 08:00-21:00"
}
</script>
JSON-LD sits in a script tag that the browser does not run; search engines read it

JavaScript-only pages and what not to do

If your page is an empty <div id="root"> until JavaScript runs, a search engine must run your JavaScript to see any content. Google can, but it may take longer; many other crawlers and link-preview bots (WhatsApp, LinkedIn) do not run JavaScript at all, so they see an empty page and miss any tags your script adds. For pages that should be found, send real HTML from the server, with server-side rendering or static generation (frameworks such as Next.js and Astro do this).

Do notWhy
Keyword stuffing ("cheap tiffin Pune cheap tiffin Pune ...")Search engines treat it as spam, and readers hate it
Rely on <meta name="keywords">Google has ignored it for many years; it does nothing
Hidden text (white on white, pushed off-screen)Against search engine spam policies; can get pages removed
Buy links or join link schemesSpam that can lead to a penalty
Copy content from other sitesAdds no value and rarely ranks
Tip: Add your site to Google Search Console (free). It shows which searches bring visitors, which pages are indexed and why others are not, your Core Web Vitals from real users, and lets you submit your sitemap.

Watch the lesson

SEO basics: help people find your pages · 1/8

Crawl → Index → Rank

Search engines crawl pages by following links, index what they find, and rank pages for each search.

Prefer a video by a teacher? Find free videos on “seo basics for web developers meta tags canonical sitemap open graph” on YouTube ↗

In real life: A coaching centre that people can find

A JEE coaching centre in Kota had a beautiful site, but every page had the title "Home", the course details were in images, and the site was built only with client-side JavaScript. After the fix, each course page has its own title and description ("JEE Main 2027 Weekend Batch, Kota: Fees and Timings"), real text with h1 and h2 headings, Open Graph tags so WhatsApp shares show a proper card, a sitemap submitted in Search Console, and server-rendered HTML. Within weeks, parents searching for weekend batches start finding the right page.

Practice (0/3 done)

Task 1 · Code · HTML

This tiffin service page has poor SEO. Fix it so that: (1) <html> has lang="en"; (2) the <title> describes the page in 10 to 60 characters (not just "Home"); (3) there is a <meta name="description"> whose content has 50 to 160 characters; (4) there is a <link rel="canonical"> whose href starts with https://; (5) there are Open Graph tags <meta property="og:title"> and <meta property="og:image">, and the image URL starts with https://; (6) the page has exactly one <h1> (make the second heading an <h2>).

Task 2 · Code · Javascript

Clean URLs help people and search engines. Write slugify(title) that turns a page title into a URL slug: make it lowercase; turn every run of characters that are not a-z or 0-9 into a single hyphen; remove hyphens at the start and end. Examples: slugify("Top 10 Tiffin Services in Pune") is "top-10-tiffin-services-in-pune" and slugify("GST: What, Why & How?") is "gst-what-why-how".

Task 3 · Practice

Check how your own site (for example your GitHub Pages portfolio) looks to search engines and in share previews, and fix what is missing.

Quick quiz

Question 1

1.What does Google do with <meta name="keywords">?

Question 2

2.Which tag sets the preview title when a link is shared on WhatsApp?

Question 3

3.The same product page opens at /phone?ref=whatsapp and at /phone. How do you tell search engines the main URL?

Question 4

4.You want a thank-you page kept out of search results. What is the right way?

Question 5

5.Your page sends only <div id="root"></div> and builds everything with JavaScript. What is the SEO risk?

Read more (free)

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

← Previous: Accessibility in depth: keyboard, ARIA and WCAG