The short version

Semantic markup means choosing HTML elements for their meaning. Use one <h1> for the title, <h2> and <h3> for sections, <article> around the post, <figure> with <figcaption> for images, and <time> for dates. Add JSON-LD BlogPosting data so search engines get an explicit description of the page.

What semantic markup does for SEO

Semantic markup means choosing each HTML element for what it means, not for how it looks. That tells browsers, search engines, and screen readers how your page is put together. It will not lift your rankings on its own, but it makes a page easier to read and index.

An <h1> is the title, a <nav> is navigation, and a <time> is a date. Assistive technology uses those elements to jump through a page. A page that browsers and crawlers can read without guessing is the foundation of good SEO.

These six elements do most of the work in a blog post. The rest of this guide shows each one in code.

ElementWhat it meansMistake to avoid
h1The title of the post, once per pageA second h1 for the logo or a sidebar title
mainThe content that is unique to this page, once per pagePutting the site header and footer inside it
articleA self-contained post that still makes sense elsewhereA plain div, so nothing marks where the post starts and ends
figureAn image together with its visible captionA caption in a loose paragraph that is not tied to the image
timeA date with a machine-readable datetime attributeA date in plain text that software has to guess
addressContact information for the author of the articleWrapping every postal address in the copy

Every blog post starts with exactly one <h1>: the title of the article. Below it, use a logical order without skipping levels, with <h2> for main sections and <h3> for subsections. That makes the article easy to scan for readers and easy to parse for machines.

You can also add an id attribute to each <h2> and <h3>, usually a short version of the heading with hyphens instead of spaces. A table of contents can then link straight to that section with a fragment such as #name-of-the-id.

All the examples in this guide belong to one made-up blog post: “Starting your first vegetable garden” by the author Sam Example on example.com. That way you can see how the pieces form a single page.

The basic structure of a blog post

Here is the basic structure of that blog post with semantic markup:

html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Starting your first vegetable garden</title>
  </head>
  <body>
    <header>
      <a href="/">
        <img src="/logo.svg" alt="Garden blog, go to the homepage" />
      </a>
      <nav aria-label="Main navigation">
        <!-- aria-label instead of a heading: navigation doesn't belong in the content outline -->
        <ul>
          <li><a href="/">Home</a></li>
          <li><a href="/blog">Blog</a></li>
          <li><a href="/contact">Contact</a></li>
        </ul>
      </nav>
    </header>
    <main>
      <article>
        <h1>Starting your first vegetable garden</h1>
        <h2>Choosing the right spot</h2>
        <p>A paragraph about sun and shade.</p>
        <h2>Preparing the soil</h2>
        <p>A paragraph about digging and compost.</p>
        <h3>Making your own compost</h3>
        <p>A paragraph about a compost bin.</p>
        <h2>What to sow in the first year</h2>
        <p>A paragraph about easy vegetables.</p>
      </article>
    </main>
    <footer>
      <nav aria-label="Footer navigation">
        <ul>
          <li><a href="/privacy">Privacy</a></li>
          <li><a href="/contact">Contact</a></li>
        </ul>
      </nav>
      <p>&copy; 2026 Garden blog</p>
    </footer>
  </body>
</html>

Notice that the navigation does not need an <h2>. Headings describe content sections; an aria-label names the <nav> landmark instead. The heading hierarchy stays clean, while screen reader users can still tell one navigation area from another.

Which landmarks does a blog post need?

Landmarks tell browsers and screen readers what each part of a page is for. A blog post needs a header, a main area with the article, and a footer. A section or an aside is often useful too.

Use <main> once per page, around the content that is unique to that page. The header, navigation, and footer stay outside it.

The site-wide <header> holds the logo and the main navigation, and the <footer> holds contact details and secondary links. Inside the article, a <header> can also group the title, the date, and the author. Give each <nav> an aria-label, so a screen reader can tell your menus apart.

Use <article> for a self-contained post: something that would still make sense if you published it somewhere else. The title, the date, and the body all belong inside it. MDN describes what the <article> element does:

represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication).

— MDN Web Docs, HTML article contents element

In short, an <article> has to stand on its own. A blog post, a news story, or a comment under an article all qualify.

Use <section> for a themed part of a page that has its own heading. If you can’t think of a heading for it, a <div> is usually the better choice.

Use <aside> for content that relates to the post but isn’t essential to it, such as an author box or a list of related articles.

Here is the same blog post twice: first built from generic <div> elements, then with semantic landmarks.

html
<!-- Before: every block is a div -->
<div class="content">
  <div class="post">
    <div class="title">Starting your first vegetable garden</div>
    <div class="date">April 14, 2026</div>
    <div class="text">A paragraph about sun and shade.</div>
  </div>
  <div class="sidebar">Related articles</div>
</div>

<!-- After: landmarks and headings carry the meaning -->
<main>
  <article>
    <h1>Starting your first vegetable garden</h1>
    <time datetime="2026-04-14">April 14, 2026</time>
    <p>A paragraph about sun and shade.</p>
  </article>
  <aside aria-label="Related articles">Related articles</aside>
</main>

Both versions can look identical on screen. Only the second one tells a browser, a screen reader, or a crawler where the post starts and ends. This page uses the same structure. The article sits in an <article>, and the date at the top is a <time> element. The author card and the related articles below it are <aside> elements. You can check that in the page source.

Images and their alt text

Images need the same care as the surrounding text. Use descriptive filenames and write alt text that explains the content or purpose of each informative image. Alt text is primarily an accessibility feature, though it can also give search engines useful context. For a purely decorative image, use an empty alt="" so screen readers skip it.

A <figcaption> provides a visible caption that connects the image to your article. The alt text describes the image for someone who cannot see it; the caption is visible to everyone. The two may overlap, but they do not need to repeat each other word for word.

Here is an image with a caption in HTML:

html
<figure>
  <img
    src="/blog/vegetable-garden-raised-beds.jpg"
    alt="Three wooden raised beds with lettuce, carrots, and beans in a small city garden"
    width="1200"
    height="800"
  />
  <figcaption>Raised beds help when your soil is heavy or contaminated.</figcaption>
</figure>

Using <time> and <address>

Use the <time> element for a machine-readable publication or modification date. The <address> element is meant for the article author’s contact information, not for every postal address that happens to appear in the copy. Link to an author page with useful information about the author and their profiles.

Here is an example using <time> and <address>:

html
<p>
  Published on <time datetime="2026-04-14">April 14, 2026</time>
</p>
<address>
  Written by <a href="/authors/sam-example">Sam Example</a>.
  Follow Sam on <a href="https://www.linkedin.com/in/sam-example/">LinkedIn</a>.
</address>

Schema markup for blog posts

Schema markup gives search engines an explicit description of the page. This kind of structured data usually comes as JSON-LD in a script element. A blog post can use Article or its more specific BlogPosting type. Here is the BlogPosting markup for the garden example:

json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Starting your first vegetable garden",
  "url": "https://www.example.com/blog/first-vegetable-garden",
  "image": [
    "https://www.example.com/blog/vegetable-garden-raised-beds-1x1.jpg",
    "https://www.example.com/blog/vegetable-garden-raised-beds-4x3.jpg",
    "https://www.example.com/blog/vegetable-garden-raised-beds-16x9.jpg"
  ],
  "datePublished": "2026-04-14T09:00:00+02:00",
  "dateModified": "2026-06-02T14:30:00+02:00",
  "author": {
    "@type": "Person",
    "name": "Sam Example",
    "url": "https://www.example.com/authors/sam-example",
    "sameAs": ["https://www.linkedin.com/in/sam-example/"]
  },
  "publisher": {
    "@type": "Organization",
    "name": "Garden blog",
    "url": "https://www.example.com",
    "logo": {
      "@type": "ImageObject",
      "url": "https://www.example.com/logo.png"
    }
  }
}

Don’t give author just a name. Add a url that points to a page that uniquely identifies the author, such as an author page, and optionally sameAs links to that person’s profiles. Google’s author markup best practices say Google understands both when it tells authors apart.

Google stopped showing FAQ rich results on May 7, 2026 (see the Google Search documentation changelog). So don’t write FAQ markup that exists only for search engines. When the same FAQ is visible on the page, you can keep using FAQPage: machines can then read the questions and answers. We still implement it on this site, and our own SEO workflow keeps recommending it. Here is an example for the FAQ under the garden article:

json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "How much sun does a vegetable garden need?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Most vegetables need at least six hours of direct sunlight a day. Leafy greens such as lettuce tolerate more shade."
      }
    },
    {
      "@type": "Question",
      "name": "When should I sow in a new vegetable garden?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Only sow outdoors once the soil has warmed up, usually from mid-April. Tender crops such as beans wait until after mid-May."
      }
    }
  ]
}

Always validate your markup after you paste it:

  1. Test the page or the code in Google’s Rich Results Test. It shows right away whether Google recognizes the supported structured data.
  2. Check the vocabulary with the Schema.org validator. It also lists types that Google doesn’t use for rich results.
  3. Look at the published page with URL inspection in Google Search Console. That shows how Google reads it.

As a quick local check, the JSON must pass JSON.parse without errors and without HTML entities such as &quot; in the text. This article also appears as a BlogPosting in JSON-LD in the page source. Its table of contents is built from the same h2 headings you read, so the headings and their anchors come from one source. The FAQ below is the exact FAQ in the FAQPage markup.

Semantic markup and AI crawlers

Semantic markup helps as a foundation, but it is no guarantee. AI crawlers such as OpenAI’s GPTBot and Anthropic’s ClaudeBot read the same server-rendered HTML as Googlebot. You decide in your robots.txt whether they may visit your site.

Don’t assume these crawlers run JavaScript. In a study by Vercel and MERJ from December 2024, the crawlers from OpenAI, Anthropic, and Perplexity, among others, did not execute JavaScript. If your article only appears after a script loads, they didn’t see it.

An article inside an <article>, with headings in the right order, makes it easier to quote one passage on its own. Structured data describes the page, but it does not guarantee that an AI answer will cite it.

What should you check before you publish?

Run through these six semantic markup checks on every new post:

  1. Use exactly one <h1>, with the title of the post.
  2. Keep headings in order, without skipping a level.
  3. Wrap the post in an <article> inside <main>.
  4. Give informative images alt text, and decorative images an empty alt="".
  5. Put dates in a <time> element with a datetime attribute.
  6. Validate your BlogPosting JSON-LD, and make sure it matches what is on the page.

Semantic markup will not rank a weak article. It makes a good one easier to read, for people and for machines.

For the editorial side, read the guide to formatting and structuring a blog post. MDN also has a useful reference on semantics in HTML.

Prefer to leave the implementation to a professional? Semantically correct HTML and valid schema come standard with every website we build. If you have questions about your own blog posts, get in touch.