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

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.
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.
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 $49 per month billed annually (see pricing).
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.
THEY TRIED SORANK BEFORE YOU
