BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
Web Development

HTML tags: What they are and which ones matter

HTML tags are the labels in angle brackets that mark where each part of a page starts and ends. A handful of them shape how search engines read the page.

Monthly searches · html tags
74.0k
Keyword research data
html tags
HTML tags: What they are and which ones matter
Click the image to view it full size

A tag is the piece of markup in angle brackets that opens or closes an element. Most elements have a start tag and an end tag, with the content between them:

<h1>Trail running shoes</h1>

<h1> is the start tag, </h1> is the end tag (note the slash), and the whole line, tags and text together, is the h1 element. People use "tag" and "element" loosely for the same thing, and that's usually fine. The difference matters when you read the standard or a validator's error messages.

Start tags can also carry attributes, which add settings: in <a href="/shoes">, href is an attribute of the a tag.

How tags fit together

Elements nest, and close in reverse order. <p><strong>Mud</strong> needs grip.</p> is right; <p><strong>Mud</p></strong> isn't.

Some elements have no end tag. These "void elements" can't contain anything, so they only have a start tag: <area>, <base>, <br>, <col>, <embed>, <hr>, <img>, <input>, <link>, <meta>, <source>, <track> and <wbr>. You may see them written with a slash, like <br />. In HTML the slash is allowed but does nothing. WHATWG

Some end tags are optional. The standard lets you leave out a few, such as </p> and </li>, where the browser can tell the element has ended. Writing them anyway is clearer and avoids surprises.

Case doesn't matter. <H1> and <h1> are the same tag. Lowercase is the convention.

The main groups of tags

Every page has the same outer shell: <html>, containing a <head> with information about the page and a <body> with what readers see. Inside, tags fall into a few families:

Group Common tags Used for
Page information (in the head) <title>, <meta>, <link>, <script>, <style> The title, description, robots rules, canonical URL, stylesheets, scripts
Page layout <header>, <nav>, <main>, <article>, <section>, <aside>, <footer> The regions of the page. See HTML5 sectioning elements.
Headings <h1> to <h6> The outline of the content
Text <p>, <ul>, <ol>, <li>, <blockquote>, <strong>, <em> Paragraphs, lists, quotes, emphasis
Links and media <a>, <img>, <picture>, <video>, <iframe> Links, images and embedded content
Tables and forms <table>, <tr>, <td>, <form>, <input>, <button> Data tables and user input

Choose tags for what the content is, not how it should look. A heading tag for a heading, a list for a list, <button> for a button. That's semantic HTML, and it's what lets screen readers and other software make sense of the page. Size and color belong in CSS.

The tags that matter for SEO

A handful of tags carry most of what search engines read from your markup:

  • <title> in the head names the page. Google uses it, with your headings and other text, to write the page's title link in results. See meta title.
  • <meta name="description"> summarizes the page and may be used for the snippet. See meta description.
  • <meta name="robots"> controls indexing and snippets, for example with noindex.
  • <link rel="canonical"> names the preferred URL among duplicates. See canonical tag.
  • <h1> to <h6> give the page its structure. See heading tags.
  • <a href="..."> is how Google finds your other pages. Google generally only follows links written this way, not click handlers on other elements. See anchor tag.
  • <img> with alt describes images. See alt attribute.

Two tags still turn up in SEO checklists but no longer do anything in Google Search: <meta name="keywords">, which Google ignores entirely, and <link rel="next"> and rel="prev" for paginated series. Google Search Central For the full list of meta tags Google reads, see meta tags.

Keep the head clean

Google needs a valid <head> to read your meta tags. The common way to break it: an element that belongs in the body, such as an <img>, a <div> or a tracking snippet with visible markup, placed in the head. The HTML parsing rules treat the first such element as the start of the body, and every <meta> and <link> after it ends up in the body. WHATWG Google accepts a canonical tag only in the head, and asks for a valid head so your other meta tags are read reliably.

Put the <title>, description, robots and canonical tags near the top of the head, and check the result with an HTML validator or your browser's developer tools. Google also advises against adding or changing meta tags with JavaScript where you can avoid it; put them in the HTML your server sends.

Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.