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

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
Quick quiz
Who should fix the technical side of your site?
Our advice for you
Check it yourself with free Google tools
Search Console lists the pages Google cannot read, and PageSpeed Insights tests speed. Many small issues are fixed from your website builder settings.
Our advice for you
A web developer
Your problem is in the code or the server: a developer who knows SEO is the right person. Give them the list of errors from Search Console.
Our advice for you
A technical audit tool
Your site has many pages: a crawler reads them all like Google does and gives a full list of errors to fix, page by page.
Our advice for you
An automatic audit, then content
Your site works but brings few visitors: technical issues are rarely the cause. Sorank audits the site, then writes the pages that bring traffic.
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.
The table below is the reference list. Tags in the head describe the page to machines; tags in the body structure what people read.
| Tag | Example | Role for SEO | Best practice |
|---|---|---|---|
| Title | <title>HTML Tags for SEO: Guide</title> | Main source of the title link in Google results | Unique per page, main keyword first, about 50 to 60 characters |
| Meta description | <meta name="description" content="..."> | Often used for the snippet under the title | Unique, 120 to 160 characters, answer plus benefit |
| Meta robots | <meta name="robots" content="noindex"> | Controls indexing and snippets | Only on pages that must stay out of the index |
| Canonical | <link rel="canonical" href="https://example.com/page"> | Names the preferred URL among duplicates | Absolute URL, one per page, pointing to an indexable page |
| Hreflang | <link rel="alternate" hreflang="fr" href="..."> | Links the language versions of a page | Reciprocal links, plus an x-default version |
| Headings | <h1> to <h6> | Show the structure and topics of the page | One clear H1, H2 for sections, H3 for sub-points |
| Image alt | <img src="..." alt="..."> | Describes the image to Google and screen readers | Short, descriptive, no keyword stuffing |
| Link rel | <a href="..." rel="sponsored"> | Qualifies paid, user-generated or untrusted links | sponsored for paid links, ugc for comments and forums |
| Viewport | <meta name="viewport" content="width=device-width, initial-scale=1"> | Signals a mobile-friendly page | On every page of a responsive site |
| Open Graph | <meta property="og:title" content="..."> | Controls the preview on social networks and messaging apps | og:title, og:description, og:image, og:url on every page |
| JSON-LD | <script type="application/ld+json"> | Structured data for rich results and machines | Matches the visible content, validated before release |
| Meta keywords | <meta name="keywords" content="..."> | None: Google does not use it | Leave it out |
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 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 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.
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.
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.
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.
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.
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.
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.
Header tags are the heading elements, H1 to H6, that label the sections of a page. Use one H1 for the topic of the page, H2 for its main parts and H3 for the points inside each part. Headings show the outline of a page to readers, screen readers and crawlers, so they should follow the logic of the content, not the size of the text.
Think of headings as a table of contents. The H1 names the subject of the whole page and should match your title tag closely. Each H2 opens a section that answers one question or covers one step. Each H3 narrows down the H2 above it. Skipping from an H1 straight to an H4 breaks that outline, and anyone who navigates by headings gets lost in the same way (see SEO accessibility).
A vague heading such as "Tags" tells the reader nothing. A heading such as Which tags does Google ignore? tells them what they will get. Put the main term near the start, keep the heading short, and avoid repeating the same keyword in every heading. Near-identical H2s make a page look like a template rather than a plan. For a method to lay out your sections, see how to format a blog post.
Many sites pick a heading level because its default font looks right. That is the most common mistake. Set the size and weight with CSS and keep the tag for the structure. A line in bold is not a heading, because the tag is what machines read. Check that the heading order still makes sense with the CSS turned off.
The HTML header element is a container for the intro of a page, such as the logo, navigation and site name. It can hold an H1, but it does not replace one. Use the H1 for the page topic, not for the site name, which repeats on every page.
H1 HTML Tags for SEO: Which Tags Matter, With Examples
H2 Which head tags control how Google shows your page?
H3 The title tag
H3 The meta description
H2 Which body tags help search engines understand the content?
H3 Headings from H1 to H6 Tip
Read only the headings, in order. If they read like a summary of the article, the outline works. If they read like a list of unrelated topics, rewrite the H2s before you change anything else.
List every heading on a page in order. You should see one H1, then H2 and H3 levels that never skip. A crawler can flag pages with no H1, several H1s or empty headings across a whole site. Also check the raw HTML: a heading that only appears after a script runs may be missing for AI crawlers that do not run JavaScript. For how the H1 works with the title, see H1 tag SEO.
Google's list of supported tags also tells you what you can stop maintaining:
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.
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 $79 per month billed annually (see pricing).
Heading tags, from h1 to h6, label each block of a page so people and machines can see where one topic ends and the next begins. Use them to show the outline of your content, in order, with no level skipped. Never pick a heading tag to make text bigger or bolder: size belongs in CSS.
Many people who use screen readers jump from heading to heading, or open a list of every heading on the page, to find what they need. If your outline goes straight from h2 to h4, they are left wondering where the missing heading went. The MDN Web Docs reference on heading elements (last updated August 2026) says it is important “to not skip one or more heading levels” for this reason. For the wider set of fixes, see our guide to SEO accessibility.
Draft the headings first, then fill in the paragraphs. Read only the headings, in order. They should name the topics of the page in a sequence a reader could follow on their own. If a heading would not work as a line in a table of contents, rename it. Our blog post formatting guide includes a heading template you can copy.
| Mistake | What it causes | Fix |
|---|---|---|
| A heading tag used to make text look bigger | A false section in the outline | Style the paragraph with CSS |
| Skipping a level, such as h2 straight to h4 | A gap that confuses screen reader users | Use an h3 for the sub-point |
| An empty heading, often an icon or a hidden label | A blank line in the heading list | Add text, or remove the tag |
| A div styled to look like a heading | Machines see no section at all | Use a real h2 or h3 element |
| A whole paragraph placed inside a heading | A long outline that hides the topics | Keep headings short and specific |
Here is the heading structure of a short help article. Each h2 is a question a reader might ask, and each h3 answers one step under it.
<h1>Indexing problems</h1>
<h2>Why is my page not indexed?</h2>
<h3>Check for a noindex tag</h3>
<h3>Check the robots.txt file</h3>
<h2>How long does indexing take?</h2> Tip
Run any page through our free heading structure analyzer to list every H1 to H6 on the page, then check the order before you publish.
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.
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.
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.
