Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 36 ยท On-Page SEO

Headings, Content Structure and Readability for SEO

Structure pages with a clean h1 to h3 outline, write readable paragraphs, use keywords naturally and check density and reading ease with runnable Python tools.

A page that is easy to scan is easy to understand, for readers and for machines. Headings divide the content into sections, tell the reader what each part is about, and give search engines a clear outline of the topics covered. Good structure also lets answers appear in snippets and helps visitors find the part they came for.

This lesson covers heading hierarchy, paragraph and list structure, natural keyword use and readability, with code that audits all of them.

The heading hierarchy

HTML has six heading levels, h1 to h6. Think of them as the table of contents of a book:

  • h1: the main topic of the page. Use one clear h1 that matches the page's purpose and agrees with the title tag. (HTML permits several, but one per page keeps the outline obvious.)
  • h2: the major sections.
  • h3: sub-sections inside an h2.
  • h4 to h6: deeper levels, rarely needed.

Rules:

  1. Do not skip levels. An h2 should be followed by h3, not h4.
  2. Use headings for structure, not looks. Never choose a tag because of its size; use CSS for appearance. Never fake a heading with bold text.
  3. Make headings meaningful on their own. "Step 3: Loosen the roots" beats "Next".
  4. Include related phrases naturally, often as questions people ask ("How deep should the pot be?").
  5. Keep them concise.
flowchart TD
    H1["h1: How to Repot a Tomato Plant"] --> A["h2: Signs it is time to repot"]
    H1 --> B["h2: What you need"]
    H1 --> C["h2: Step-by-step"]
    C --> C1["h3: Remove the plant"]
    C --> C2["h3: Loosen the roots"]
    C --> C3["h3: Replant deeper"]
    H1 --> D["h2: Aftercare"]

One h1, several h2 sections, h3 sub-steps. A reader (or a screen reader) can understand the page from this outline alone.

Try it: audit a heading outline

The program below parses an HTML snippet, prints its outline and flags missing or multiple h1 headings and skipped levels.

Python Heading outline auditor

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The sample has two h1 headings and two skipped levels, which the checker reports.

Paragraphs, lists and tables

How you format text matters as much as what you write.

  • Short paragraphs: two to four sentences. A wall of text drives people away.
  • Answer first: state the main point in the first sentences, then support it.
  • Lists for steps (ol) and options (ul). Search engines can lift a clean list into a snippet.
  • Tables for comparisons. Mark up header cells with th.
  • Bold sparingly for key terms, never to shout keywords.
  • Descriptive link text, not "click here" (see internal links).
  • A short introduction and a summary help both skimmers and snippets.

Use semantic HTML: article, section, nav, main, aside, figure, time. It gives machines extra clues without changing the look.

Length: write what the topic needs

There is no ideal word count. Look at the intent and the leading pages: a definition may need 300 words, a full guide 3,000. Length should come from covering the topic fully, never from padding. If you can cut a paragraph without losing information, cut it.

Keywords in the text

Place the primary phrase where it is natural and useful: the title, the h1, the first paragraph, one or more headings, the URL, the image alt text where relevant and the closing paragraph. After that, stop counting. Use synonyms, related terms and the questions people ask. Search engines understand meaning; you do not need an exact-match phrase in every sentence.

Keyword density (occurrences divided by total words) was once discussed as a target. Search engines do not use a fixed ideal percentage. Use density only as a warning signal: if one phrase takes a big share of the text, it probably reads badly.

Python Keyword density and prominence

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Readability

Readable text keeps people on the page. The Flesch reading ease score estimates difficulty from sentence length and syllables per word: higher scores mean easier text (roughly 60 to 70 is plain English, below 30 is very hard). It was designed for English only, and it is a rough tool, but it highlights long sentences and jargon. The syllable counter below is approximate, and very long single sentences can push the score below zero or above 100.

Python Flesch reading ease

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

To improve readability: shorten sentences, choose common words, explain unavoidable jargon once, use active voice, and break long sections with subheadings. Remember your reader: an expert audience can handle technical language; a beginner audience cannot.

A page structure that works

  1. h1 and a short intro that answers the main question.
  2. A mini table of contents for long pages (links to h2 ids).
  3. Sections in the order the reader needs them, each with a clear h2.
  4. Evidence: images, tables, examples, quotes.
  5. A summary or next steps.
  6. Related links to other pages on your site.

Common mistakes

  • Several different topics under one h1.
  • Headings used for styling (a big "Sale!" in an h2).
  • Empty headings or headings that are only an image without alt text.
  • Keyword stuffing in every heading.
  • Dense paragraphs of 200 words.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What should the h1 of a page do?

    The h1 introduces the main topic; one clear h1 keeps the outline obvious.
  2. 2. Which heading sequence has a problem?

    The h4 skips over h3, which breaks the outline.
  3. 3. How should keyword density be used?

    No ideal percentage exists. A very high density signals unnatural writing.
  4. 4. A higher Flesch reading ease score means the text is what?

    Higher scores indicate easier text: shorter sentences and shorter words.

Summary

  • Use one clear h1, then h2 and h3 sections without skipping levels; headings are for structure.
  • Write short paragraphs, answer first, and use lists and tables where they fit.
  • Use the primary phrase naturally in key places, and rely on related terms and meaning.
  • Check readability and avoid long, jargon-heavy sentences.

Next: SEO-Friendly URLs and Slugs