Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website. More information (Cookie Policy)

Accept all cookies

HTML Tags for SEO: Which Tags Matter, With Examples

HTML tags for SEO explained: title, meta description, robots, canonical, hreflang, headings, alt and schema, with examples and the tags Google ignores.

Published on:
19/10/2026
-
Updated on:
19/10/2026
Cover of the guide to HTML tags for SEO, showing a page's head and body tags with their role

Tools

Thibault Besson-Magdelain, founder of Sorank

About Author

Thibault Besson-Magdelain

Founder of Sorank, 7+ years of experience in SEO, GEO enthusiast.
On this page

In short

the HTML tags that matter for SEO fit in a short list: the title tag, the meta description, the meta robots tag, the canonical link, hreflang for multilingual sites, one clear H1 with logical H2 and H3 headings, alt text on images, rel attributes on links, the viewport tag, Open Graph tags and JSON-LD structured data. Google ignores the meta keywords tag and any meta tag it does not support. Put every important tag in the raw HTML, because some crawlers, including several AI crawlers, do not run JavaScript.

Want to go further? Ask

Search engines and AI assistants read your page as code before anyone sees it on screen. A handful of HTML tags for SEO decide how that code is understood: which URL gets indexed, which title appears in the results, what the page is about and how it looks when shared. Google lists the meta tags and attributes it supports on a single page of its Search Central documentation, and everything outside that list has no effect on Google Search. This guide covers each useful tag with an example, the mistakes to avoid and the tags you can forget.

Which HTML tags matter for SEO?

The table below is the reference list. Tags in the head describe the page to machines; tags in the body structure what people read.

TagExampleRole for SEOBest practice
Title<title>HTML Tags for SEO: Guide</title>Main source of the title link in Google resultsUnique per page, main keyword first, about 50 to 60 characters
Meta description<meta name="description" content="...">Often used for the snippet under the titleUnique, 120 to 160 characters, answer plus benefit
Meta robots<meta name="robots" content="noindex">Controls indexing and snippetsOnly on pages that must stay out of the index
Canonical<link rel="canonical" href="https://example.com/page">Names the preferred URL among duplicatesAbsolute URL, one per page, pointing to an indexable page
Hreflang<link rel="alternate" hreflang="fr" href="...">Links the language versions of a pageReciprocal links, plus an x-default version
Headings<h1> to <h6>Show the structure and topics of the pageOne clear H1, H2 for sections, H3 for sub-points
Image alt<img src="..." alt="...">Describes the image to Google and screen readersShort, descriptive, no keyword stuffing
Link rel<a href="..." rel="sponsored">Qualifies paid, user-generated or untrusted linkssponsored for paid links, ugc for comments and forums
Viewport<meta name="viewport" content="width=device-width, initial-scale=1">Signals a mobile-friendly pageOn every page of a responsive site
Open Graph<meta property="og:title" content="...">Controls the preview on social networks and messaging appsog:title, og:description, og:image, og:url on every page
JSON-LD<script type="application/ld+json">Structured data for rich results and machinesMatches the visible content, validated before release
Meta keywords<meta name="keywords" content="...">None: Google does not use itLeave it out

Which head tags control how Google shows your page?

The title tag

The title tag is the most important tag on the page. Google says there is no limit on the length of a title element, but the title link is truncated to fit the device width, which in practice means about 50 to 60 characters on desktop. Google can also rewrite it: its documentation lists the sources it uses, from the title element and the main visible title to H1 headings, the og:title tag and the anchor text of links pointing to the page. A title that matches the H1 and the page content is the one Google keeps. Write a unique title for every page, with the main keyword near the start and the brand at the end.

The meta description

The meta description does not change rankings, but it often supplies the snippet under the title and therefore influences clicks. Google may replace it with a passage of the page that better matches the query. Write it as a short answer followed by a benefit, between 120 and 160 characters, and never reuse the same description on several pages.

The meta robots tag

The robots meta tag tells crawlers what they may do with the page. The most used value is noindex, which keeps a page out of the results; others include nofollow, nosnippet and max-snippet, which limits the length of the text snippet. For files that have no head section, such as PDFs, the same directives go in the X-Robots-Tag HTTP header. A noindex left on a live template is one of the most common causes of lost traffic, so check it after every release.

Viewport and charset

Google states in its documentation that the presence of the viewport tag indicates a mobile-friendly page. Since Google indexes the mobile version of sites, this tag belongs on every page. The charset declaration (UTF-8 is Google's recommendation) prevents broken characters in titles and snippets, which matters on multilingual sites.

Which tags tell Google which URL to index?

Two link tags in the head manage duplicates and languages. The canonical tag names the preferred version when the same content is reachable through several URLs (filters, tracking parameters, HTTP and HTTPS). Google treats it as a strong hint, alongside redirects and internal links, so it works best when all signals point to the same URL. Use an absolute URL, keep one canonical per page and never point it to a page that is blocked or set to noindex.

The hreflang attribute tells Google which page to show to which language or region. According to Google's guide to localized versions, each version must list itself and all the others, and an x-default value can name the page for users whose language is not covered. Missing return links are the most frequent hreflang error: if page A points to page B, page B must point back to page A.

Which body tags help search engines understand the content?

Headings from H1 to H6

Headings give the outline of the page. Use one H1 that states the topic, H2 tags for the main sections and H3 tags for steps or items inside a section, without skipping levels for visual effect. Google has said that several H1 tags do not cause a penalty, but a single clear H1 remains the simplest structure for users and assistive technologies. Question-shaped H2 headings ("How does X work?") also match the way people phrase searches and prompts.

Alt text on images

Google explains in its image SEO guidelines that it uses alt text together with computer vision and the content of the page to understand an image, and that filling alt attributes with keywords may cause a site to be seen as spam. Describe what the image shows in a short phrase. Google also notes that it does not index CSS background images, so any image that should rank needs a real img element.

The a element is how crawlers discover pages, so internal links must be real links with an href, not buttons handled by JavaScript. The rel attribute qualifies outbound links: sponsored for paid placements, ugc for comments and forum posts, nofollow for links you do not want to endorse. Google has treated these values as hints since 2020. Descriptive anchor text helps both users and search engines.

Semantic HTML5 elements

Elements such as main, article, nav, header, footer and section tell machines which part of the page is the main content and which parts repeat on every page. They do not boost rankings on their own, but they make the main content easier to isolate, for search engines, screen readers and AI tools alike. Our guide to semantic HTML details each element. Inside the text, strong and em mark emphasis; use them for key terms, not whole paragraphs.

Which tags shape social previews and rich results?

The Open Graph protocol, created by Facebook and now read by most social networks and messaging apps, defines the og:title, og:description, og:image and og:url tags that build the preview card when a page is shared. Without them, platforms guess, often with the wrong image. You can test the result with an Open Graph preview tool before publishing.

Structured data in JSON-LD format, placed in a script tag, describes the page with the Schema.org vocabulary: article, product, organization, breadcrumb, FAQ. Google uses it for rich results, and it gives AI systems explicit facts about the entity behind the page. The markup must describe what is visible on the page. We cover its role for AI answers in our guide to structured data and AI search.

Which HTML tags does Google ignore?

Google's list of supported tags also tells you what you can stop maintaining:

  • Meta keywords: Google states that the meta keywords tag is not used by Google Search and has no effect on indexing or ranking.
  • Unknown meta tags: Google ignores meta tags it does not support, such as meta author or meta revisit-after.
  • The lang attribute: Google detects the language of a page from its text, not from the lang attribute. Keep the attribute for accessibility and other tools, and use hreflang to link language versions.
  • Meta refresh as a redirect: it works, but Google recommends a server-side 301 redirect instead.

Do HTML tags matter for AI answers?

Yes, and for a simple reason: ChatGPT, Claude, Gemini and Perplexity extract passages from pages, and clean HTML makes those passages easy to find. Several AI crawlers fetch the raw HTML without running JavaScript, so a title, a canonical or a block of text injected by scripts may never reach them. A clear heading hierarchy splits the page into self-contained answers, lists and tables keep facts together, and structured data states the facts without ambiguity. This is the technical side of generative engine optimization: the same tags that help Google also help AI assistants quote you accurately.

How do you check the HTML tags of a page?

  1. Read the raw source. Open the source code (Ctrl+U) and search for the title, meta description, robots, canonical and hreflang tags. If a tag only appears in the rendered page, it depends on JavaScript.
  2. Compare with Google's view. The URL Inspection tool in Google Search Console shows the HTML that Google rendered and the canonical it selected.
  3. Audit page by page. The free Sorank Chrome extension lists missing or duplicate tags and the fixes for the page you are viewing.
  4. Audit the whole site. A crawler finds duplicate titles, missing alt text and wrong canonicals across thousands of URLs; our selection of technical SEO tools compares the options.
  5. Re-check after each release. Template changes are where noindex tags, broken canonicals and empty titles appear.

Getting the dozen tags above right covers almost everything HTML can do for SEO; the rest of the work is content and links. If you want pages that already ship with clean titles, headings, internal links and structured content, Sorank's article generator writes and publishes them on autopilot, from $49 per month billed annually (see pricing).

Frequently asked questions

How many H1 tags should a page have?

One H1 per page is the simplest and clearest choice. Google has said that several H1 tags do not cause a penalty, but a single H1 that states the topic helps users, screen readers and search engines understand the page at a glance.

Is the meta description a ranking factor?

No. Google presents the meta description as a possible source for the snippet shown under the title, not as a ranking signal. A clear description still matters because it influences how many people click on your result.

Do I need to edit HTML tags by hand in WordPress or Shopify?

Usually not. WordPress with an SEO plugin and Shopify generate the title, meta description, canonical and Open Graph tags from fields in the editor. Check the source code of a few pages anyway, because themes and apps sometimes add duplicate or conflicting tags.

Our Blog for Ambitious Company

Our free SEO tools

See all our free tools

THEY TRIED SORANK BEFORE YOU

Testimonials from ambitious founders

Organic growthE-commerce

0 to 10000 visitors in 5 months

Celio Fabianomonrobotlavevitre.fr
Organic growthSoftware

0 to 5000 clients in 8 months

Thibault BMsorank.com
Organic growthLeisure and aviation

0 to 1104 clicks in 4 months

Dominiqueflight-sensations-idf.com
Organic growthMusic software

x30 clicks in 4 months

Valentin Cordiertiger-sounds.com
Organic growthHealth and wellness

x30 clicks in 4 months

Rodrigue Bretonalthevia.com