Tagging for SEO: Every Tag With Code and What Google Does (2026)

SEO Tagging Best Practices: The Rules and Mistakes for Every Tag

Tagging for SEO means two different things, and searchers use the phrase for both. The first is the HTML tags in your page code that Google reads: the <title>, meta description, meta robots, canonical, hreflang, headings, image alt text, Open Graph and X card tags, and structured data. The second is the tags you attach to posts in WordPress or another CMS, each of which creates a tag archive page that can help or bloat your site. This page covers both, with copy-ready code for every tag, what Google’s own documentation says it does with each one, the mistake that breaks it, and the free tool that shows you whether it is working.

Every Google behavior below is quoted from Google Search Central, with the page’s last-updated date where Google shows one. Where Google says a tag does nothing, the table says so too.

The SEO tag reference table: what Google does with each tag

Read across a row: the tag, what Google actually does with it, the mistake that most often breaks it, and how to check it on a live page. The copy-ready code for all of them, in one block, follows the table.

TagWhat Google actually does with itMost common mistakeHow to check it
Title element
<title>…</title>
Main source for the clickable title link, but not the only one. Google also draws on the H1, og:title, prominent text, anchor text and WebSite structured data, and Google says “there’s no limit on how long a <title> element can be” (title links doc).Half-empty titles (“| Site Name”), the same title on a whole set of pages, an old year left in the title.View source; Screaming Frog free crawl, Page Titles tab.
Meta description
<meta name="description">
A snippet candidate only. “Snippets are primarily created from the page content itself” and Google uses the description when it is more accurate (snippet doc). Not used in ranking (Google, 2009).One description copied across every page. Google says identical descriptions “aren’t helpful”.Screaming Frog free crawl, Meta Description tab, filter “Duplicate”.
Meta robots
<meta name="robots">
Controls indexing and snippets: noindex, nofollow, nosnippet, max-snippet, max-image-preview and more. Conflicting rules: “the more restrictive rule applies” (robots meta doc).A leftover sitewide noindex from staging; noindex on a page that robots.txt blocks, so Google never sees it.URL Inspection, “Indexing allowed?” line.
X-Robots-Tag header
X-Robots-Tag: noindex
Same rules as meta robots, sent as an HTTP header. The only way to noindex PDFs and other non-HTML files.Set on the wrong server block, so it never reaches the file.curl -sI on the file URL.
Canonical
<link rel="canonical">
A “strong signal”, not a command. Google calls your canonical preference “a hint, not a rule” and may pick a different URL (canonicalization doc).Relative URLs, a canonical pointing at a redirected or noindexed URL, the sitemap listing a different URL.URL Inspection: “User-declared canonical” vs “Google-selected canonical”.
hreflang
<link rel="alternate" hreflang>
Tells Google which language or regional version to show. “If two pages don’t both point to each other, the tags will be ignored” (localized versions doc).Missing return links; en-uk instead of en-gb; a region code with no language.Screaming Frog free crawl, Hreflang tab.
Headings
<h1>…<h6>
Help users and Google read the page. Google says heading order “doesn’t matter” and “there’s no magical, ideal amount of headings” (SEO Starter Guide).Several equally large headings, so Google cannot tell which is the main title and rewrites the title link.Browser dev tools or a headings outline extension.
Image alt
<img alt>
Google “uses alt text along with computer vision algorithms and the contents of the page” to understand images. Google does not index CSS background images (Google Images doc).Keyword lists in alt; key images set as CSS backgrounds.Screaming Frog free crawl, Images tab, “Missing Alt Text”.
Open Graph
<meta property="og:…">
Built for social previews. Google lists og:title as a title link source and og:image as a way to name the page’s preferred image (Google Images doc).No og:image, so platforms pick a logo or a random image.Meta Sharing Debugger.
X (Twitter) card
<meta name="twitter:card">
Not a Google signal. X uses it to choose the card layout and falls back to og: tags for title, description and image.SVG card images, which X does not support.Paste the URL into a draft post on X and check the preview.
Structured data
<script type="application/ld+json">
Makes a page eligible for rich results, with no guarantee: “Google does not guarantee that your structured data will show up” (structured data policies).Marking up content that is not visible on the page; still building FAQ markup for rich results that no longer appear.Rich Results Test; Search Console rich result reports.
Viewport
<meta name="viewport">
“Presence of this tag indicates to Google that the page is mobile friendly” (meta tags Google supports).Missing on old templates or landing page builders.View source.
Meta keywords
<meta name="keywords">
Ignored. “Not used by Google Search, and it has no effect on indexing and ranking at all” (meta tags Google supports).Spending time on it; publishing your keyword list to competitors.Nothing to check. Delete it or leave it.

Notice what the table does not say: that any of these tags is a ranking factor you can turn up. The title and headings tell Google what the page is about, the rest control what gets indexed and how the listing looks. Where to put the keyword itself inside the title, H1 and alt text is a separate question, and our guide on how to add SEO keywords in HTML covers it slot by slot.

SEO tagging techniques: one copy-ready head template

This is every tag from the table in one <head>, using a fictional Austin estate planning firm so the values look like real copy instead of placeholders. Swap in your own values. Delete the hreflang lines if you only have one language version, and the robots line if you do not need to restrict anything: with no robots tag, Google treats the page as all, the default.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <!-- Mobile: Google reads this as a mobile-friendly signal -->
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <!-- Title: the main source Google uses for the title link -->
  <title>Estate Planning Attorney in Austin, TX | Smith Law</title>

  <!-- Description: a snippet candidate, not a ranking signal -->
  <meta name="description" content="Wills, revocable trusts and powers of attorney for Austin families. Flat-fee packages listed on the page. Book a 20-minute call.">

  <!-- Robots: only add when you need to restrict something -->
  <meta name="robots" content="max-snippet:-1, max-image-preview:large">

  <!-- Canonical: absolute URL of the version you want indexed -->
  <link rel="canonical" href="https://www.example.com/estate-planning-austin/">

  <!-- hreflang: only if you have translated or regional versions -->
  <link rel="alternate" hreflang="en-us" href="https://www.example.com/estate-planning-austin/">
  <link rel="alternate" hreflang="es-us" href="https://www.example.com/es/planificacion-patrimonial-austin/">
  <link rel="alternate" hreflang="x-default" href="https://www.example.com/estate-planning-austin/">

  <!-- Open Graph: social previews; Google can also read og:title and og:image -->
  <meta property="og:type" content="website">
  <meta property="og:title" content="Estate Planning Attorney in Austin, TX">
  <meta property="og:description" content="Wills, trusts and powers of attorney, with flat-fee packages.">
  <meta property="og:url" content="https://www.example.com/estate-planning-austin/">
  <meta property="og:image" content="https://www.example.com/img/estate-planning-austin-1200x630.webp">
  <meta property="og:image:width" content="1200">
  <meta property="og:image:height" content="630">
  <meta property="og:image:alt" content="Attorney reviewing a trust document with a couple at a desk">

  <!-- X card: set the card type; X falls back to og: tags for the rest -->
  <meta name="twitter:card" content="summary_large_image">

  <!-- Structured data: must describe what is visible on the page -->
  <script type="application/ld+json">
  {"@context":"https://schema.org","@type":"LegalService","name":"Smith Law",
   "url":"https://www.example.com/estate-planning-austin/",
   "address":{"@type":"PostalAddress","addressLocality":"Austin","addressRegion":"TX"}}
  </script>
</head>

Three details in that block are deliberate. The canonical and og:url use the same absolute URL, because Google says to “use absolute paths rather than relative paths” in canonicals and not to “specify different URLs as canonical for the same page using different canonicalization techniques” (Google, duplicate URLs doc, updated 10 July 2026). The og:image carries its width and height, which Meta recommends so the image “loads properly the first time it’s shared”. And there is no meta keywords tag, because Google ignores it.

If a JavaScript framework writes these tags in the browser instead of the server, check the raw HTML too. Google’s December 2025 guidance says not to put a noindex in the original page code of a page you want indexed, and to set the same canonical in the original HTML as the one JavaScript writes (Search Central updates log). Our JavaScript SEO testing guide has the commands to compare the two versions.

Title and meta description: what Google rewrites and why

Google does not set a character limit for either tag. Titles and snippets are “truncated in Google Search results as needed, typically to fit the device width” (snippet doc, updated 20 April 2026). So the 60 and 155 character targets you see everywhere are display rules of thumb, not Google rules. Front-load the words that matter so the truncated version still makes sense.

Google’s title links documentation lists the six problems that most often make it replace your title with its own:

Problem Google namesWhat it looks likeFix
Half-empty title| Smith LawPut the page’s real subject before the brand.
Obsolete title“2025 Tax Deadlines” on a page updated for 2026Update the title when the visible date changes.
Inaccurate titleCategory page titled with one product that sold outDescribe what the page shows now.
Micro-boilerplate50 location pages titled “Services | Smith Law”Put the distinguishing detail (the city) in each title.
No clear main titleThree headings in the same large fontMake one heading, ideally the first visible H1, stand out.
Language mismatchEnglish title on a Spanish pageMatch the page’s language and script.

For descriptions, Google’s own advice is narrow: unique per page, a site-level description only on the home page or aggregation pages, and on large database-driven sites “programmatic generation of the descriptions can be appropriate and are encouraged.” Write them by hand on pages that earn money, and generate them from page data everywhere else. Formulas and length testing for titles are in our title tag optimization playbook.

Meta robots, nosnippet and max-snippet: the tags that control indexing and AI answers

The robots meta tag is the one tag that can remove a page from Google, so it deserves the most care. Google’s current list of valid rules is: all, noindex, nofollow, none, nosnippet, indexifembedded, max-snippet, max-image-preview, max-video-preview, notranslate, noimageindex and unavailable_after (robots meta doc, updated 24 March 2026). noarchive is no longer on it: Google moved it to unused rules because the cached link feature is gone.

<!-- Keep a page out of Google entirely (thank-you pages, internal search results) -->
<meta name="robots" content="noindex">

<!-- Index the page but show no text snippet (also limits what AI Overviews can quote) -->
<meta name="robots" content="nosnippet">

<!-- Cap the snippet at 160 characters and allow large image previews -->
<meta name="robots" content="max-snippet:160, max-image-preview:large">

<!-- Hide one block (a fee table, a disclaimer) from snippets only -->
<div data-nosnippet>Fees quoted here change each January.</div>

<!-- Rules for Google only; other engines ignore this one -->
<meta name="googlebot" content="noindex">

Snippet controls now matter beyond the blue link. Google’s AI features page says: “To limit the information shown from your pages in Search, use nosnippet, data-nosnippet, max-snippet,” with noindex to keep a page out entirely, and that “there are no additional requirements to appear in AI Overviews or AI Mode” (AI features doc). So there is no special AI tag to add. If you want to be quoted, the technique is to not restrict snippets on the pages you want cited. Note that data-nosnippet only works on span, div and section elements.

The robots.txt trap

If robots.txt blocks a URL, Google cannot crawl it, so “any information about indexing or serving rules will not be found.” A page that is both disallowed in robots.txt and tagged noindex can stay in the index, because Google never reads the tag. To remove a page, allow crawling and serve the noindex. For files that cannot carry a meta tag, send the header instead:

# Apache .htaccess: noindex every PDF on the site
<FilesMatch "\.pdf$">
  Header set X-Robots-Tag "noindex"
</FilesMatch>

# Check it from the command line
curl -sI https://www.example.com/files/fee-schedule.pdf | grep -i x-robots-tag

After any noindex change, run the URL through URL Inspection. The “Indexing allowed?” line tells you whether Google saw the rule. Why pages fall out of the index for other reasons is covered in our explainer on what SEO indexing is and how to fix non-indexed pages.

Canonical and hreflang: two hint tags that fail quietly

Both tags look like instructions and both are treated as signals, which is why they break without an error message. Google ranks its canonicalization signals: redirects and rel="canonical" are each “a strong signal,” sitemap inclusion is “a weak signal,” and they “can stack” (duplicate URLs doc). When signals disagree, Google picks. The rules that keep it picking your URL:

  1. Use an absolute URL in the canonical, including https:// and the exact host (www or not).
  2. Point it at a URL that returns 200, is not redirected and is not noindexed.
  3. List the same URL in the XML sitemap and in internal links.
  4. Do not use robots.txt, noindex or the URL removal tool to choose a canonical. Google says not to do any of the three.
  5. Check the result: URL Inspection shows the “User-declared canonical” next to the “Google-selected canonical” (URL Inspection help). If they differ, one of the four rules above is being broken somewhere.

Hreflang has stricter rules than most people expect. “Each language version must list itself as well as all other language versions,” the return links must exist on both sides, and codes must be ISO 639-1 language plus optional ISO 3166-1 Alpha 2 region. Google says using EU, UN or UK “doesn’t have an effect” (localized versions doc, updated 21 September 2026). Google also says it doesn’t use hreflang or the HTML lang attribute to detect a page’s language: it reads the text.

<!-- Wrong: "uk" is not a valid region code, so Google ignores it -->
<link rel="alternate" hreflang="en-uk" href="https://www.example.com/uk/">

<!-- Wrong: region alone, no language -->
<link rel="alternate" hreflang="gb" href="https://www.example.com/uk/">

<!-- Right -->
<link rel="alternate" hreflang="en-gb" href="https://www.example.com/uk/">

Headings and alt text: what Google says versus the usual rules

Two common tagging rules are stricter than Google. “Use exactly one H1” and “never skip a heading level” are good accessibility habits, but Google’s SEO Starter Guide lists “number and order of headings” among the things not to focus on (SEO Starter Guide). The rule that does have a Google consequence is prominence: when several headings look equally important, Google may build the title link from something other than your title. One clearly dominant H1 that matches the title avoids that.

For alt text, Google’s own examples run from bad (no alt), to bad (keyword stuffing, which “may cause your site to be seen as spam”), to better (alt="puppy"), to best (alt="Dalmatian puppy playing fetch"). It also prefers descriptive filenames over names like IMG00023.JPG (Google Images doc, updated 2 March 2026). The same pattern for a service firm:

<!-- Bad: no alt -->
<img src="IMG00023.jpg">

<!-- Bad: keyword list -->
<img src="team.jpg" alt="cpa firm dallas accountant dallas tax preparer dallas cpa">

<!-- Good: says what the image shows -->
<img src="dallas-cpa-team-2026.webp" alt="Four CPAs from the Dallas office reviewing a client's quarterly tax estimate">

<!-- Decorative divider: empty alt so screen readers skip it -->
<img src="divider.svg" alt="">

Open Graph, X cards and structured data: the tags for previews and rich results

Open Graph needs four properties to be valid: og:title, og:type, og:image and og:url (Open Graph protocol). Add og:description and og:image:alt, which the spec defines as “a description of what is in the image (not a caption).” Two platform facts save debugging time:

  • Facebook and other Meta apps cache images by URL. “Images are cached based on the URL and won’t be updated unless the URL changes.” Rename the image file when you replace it, then rescrape the page in the free Sharing Debugger (Meta webmaster docs).
  • X reads your og: tags. X’s card markup reference maps each twitter: tag to an Open Graph fallback, and if og:type, og:title and og:description exist without twitter:card, “a summary card may be rendered.” Add twitter:card with summary_large_image to get the large image. X’s limits: title 70 characters, description 200, image under 5MB in JPG, PNG, WEBP or GIF, no SVG, image alt up to 420 characters (X cards markup reference, archived 1 February 2026, since the live developer.x.com page now redirects).

For structured data, Google “recommends using JSON-LD” (intro to structured data) and has three rules you cannot skip: mark up only what is visible on the page, expect no guarantee of a rich result, and know that a structured data manual action removes rich result eligibility but “does not affect ranking in web search” (structured data policies, updated 10 July 2026). Check which features still exist before you build markup for one. FAQ rich results stopped appearing in Google Search on 7 May 2026 and HowTo rich results were dropped in 2023 (Search Central updates log), and neither appears in Google’s current search gallery. FAQ markup can still describe your page to other systems. How it helps AI citations is covered in our guide to schema markup for AI search citations.

Tagging for SEO in WordPress: when to noindex tag archives

In WordPress, every tag you add to a post creates a public archive at a URL like /tag/estate-planning/ that lists every post with that tag. Ten tags on one post can mean ten new pages. Yoast’s founder warns against tagging “very liberally” with 10 to 20 unique tags per post and says archives with “1 or 2 posts” are “not very useful” (Yoast, Tagging posts properly).

The two biggest SEO plugins lean in opposite directions. Yoast says “it’s usually best to allow search engines to show taxonomies in their search results” (Yoast help: Categories & tags). Rank Math’s documentation notes that “most websites will no-index tag archives” (Rank Math: Titles and Meta). Both are right for different sites, so decide per tag with a test instead of a default.

The tag archive pass/fail test

This is my rule of thumb, not a Google rule. Keep a tag archive indexable only if it passes all five checks. One fail means noindex it, or merge it into a better tag and redirect.

#CheckPassFail
1Volume5 or more published posts on the tag, and more planned1 to 4 posts, or a tag used once and forgotten
2Search demandThe tag name is a phrase people search (it shows impressions in Search Console or a keyword tool)Internal labels such as “news”, “update”, “misc”, “featured”
3No duplicateNo category, other tag or post already targets the same phrase“Estate planning” as both a category and a tag, or plural and singular tags (“trust” and “trusts”)
4Unique archive copyThe archive has its own intro paragraph, title and meta descriptionA bare list of post excerpts with the template title
5Useful as a landing pageA searcher landing on it would find a better answer than any single postA single post would answer the query better

On most professional service firm blogs, almost every tag fails check 1 or 3, which is why sitewide noindex on tags is the usual answer there. Categories are a different decision: they are the structure, so they should usually pass.

The exact settings in Yoast and Rank Math

  1. Yoast SEO, all tags: Yoast SEO, then Settings, then Categories & tags, then Tags. Turn off “Show tags in search results”. The plugin’s own description of that toggle: “Disabling this means that archive pages for tags will not be indexed by search engines and will be excluded from XML sitemaps” (Yoast SEO source code). Yoast also keeps a noindex setting on each tag’s own edit screen, in the Yoast box, if you want to keep a few strong tags indexed.
  2. Rank Math, empty archives: Rank Math SEO, then Titles & Meta, then Global Meta. Turn on “Noindex Empty Category and Tag Archives”. Rank Math says: “We recommend that you enable this option.”
  3. Rank Math, all tags: Titles & Meta, then Tags. Change “Tag Archives Robots Meta” from Default to Custom and tick No Index (Rank Math: Titles and Meta).
  4. Either plugin: do not also add Disallow: /tag/ to robots.txt. That blocks Google from seeing the noindex, as covered above.
  5. Verify: open one tag URL in URL Inspection, run the live test and confirm “Indexing allowed?” reads No with noindex detected. Then confirm the tag sitemap is gone or empty.

The rest of the plugin setup, from permalinks to sitemaps, is in our WordPress SEO setup guide.

A 15-minute tag audit with free tools

Run these in order on your five most important pages, then crawl the site. Each step has one pass condition.

  1. View source (Ctrl+U, or Cmd+Option+U on a Mac). Pass: one <title>, one description, one canonical, a viewport tag, no stray noindex.
  2. URL Inspection in Search Console. Pass: “Indexing allowed?” is Yes and the Google-selected canonical matches the user-declared one. There is a per-property daily limit on inspections and live tests, though Google does not publish the number (URL Inspection help).
  3. Rich Results Test. Pass: the types you marked up are detected with no errors. It needs no login, tests a URL or pasted code, crawls as Google-InspectionTool with smartphone as the default, and keeps shared results for about 90 days (Rich Results Test help).
  4. Screaming Frog SEO Spider, free version. Pass: no duplicate or missing titles and descriptions, no unexpected noindex, no hreflang errors. The free version crawls up to 500 URLs and includes page titles and meta data, meta robots and directives, hreflang auditing and exact duplicate detection. It does not include JavaScript rendering or structured data validation, which need the paid licence at $279 a year (Screaming Frog pricing).
  5. Sharing Debugger and an X draft post. Pass: the right image, title and description appear in both previews.

If a tag fails, fix the template, not the page. Duplicate titles and leftover noindex rules almost always come from one theme file or one plugin setting, so one fix clears hundreds of URLs. Getting the tags right is the “be crawlable, indexable and snippet-eligible” step in our SEO principles. It does not make a weak page rank, but a wrong tag can stop a strong page from ranking at all. If you want a second pair of eyes on a template before it ships sitewide, you can book a consultation.

Frequently asked questions

What is tagging for SEO?

Tagging for SEO means two things. First, the HTML tags in your page code that Google reads, such as the title, meta description, meta robots, canonical, hreflang, headings, image alt text, Open Graph and structured data. Second, the tags you add to posts in WordPress or another CMS, which create tag archive pages. Good tagging gets the first set right on every template and indexes only the tag archives that deserve to rank.

What are the most important SEO tags?

The title element and meta robots tag matter most: the title is Google's main source for your title link, and a wrong robots rule can remove a page from search. After those come the canonical, which steers which URL gets indexed, the meta description, image alt text, hreflang for multilingual sites, Open Graph for social previews and JSON-LD structured data for rich results. Google ignores the meta keywords tag.

Should tag pages be indexed or noindexed in WordPress?

Noindex any tag archive that has fewer than about five posts, duplicates a category or another tag, or has no unique intro copy. Index only tags that people actually search for and that make a useful landing page. In Yoast, turn off Show tags in search results under Settings, Categories and tags. In Rank Math, set Tag Archives Robots Meta to No Index under Titles and Meta, Tags.

Does Google still use the meta keywords tag?

No. Google's documentation says the meta keywords tag is not used by Google Search and has no effect on indexing and ranking at all. Google has said it does not use the tag for web ranking since 2009. You can delete it from your templates. Leaving it in does no harm to rankings, but it shows competitors the keyword list you are targeting.

How many tags should a blog post have for SEO?

There is no official number from Google. Yoast warns against tagging very liberally with 10 to 20 unique tags per post, because each tag creates an archive page and most of those end up thin. A practical range is one to three tags per post, chosen from an existing list of tags you have already decided to keep, rather than inventing new ones each time you publish.

Do I need exactly one H1 tag per page for SEO?

Google says the number and order of headings is not something to focus on, so multiple H1s are not a penalty. One clearly dominant H1 that matches your title is still the safer pattern, because Google may rewrite your title link when several headings look equally important. A single H1 and an ordered heading outline also help screen reader users move through the page.

How do I check my SEO tags for free?

View the page source to read the tags directly. Use URL Inspection in Search Console to see whether indexing is allowed and which canonical Google selected. Use Google's Rich Results Test for structured data. Crawl up to 500 URLs with the free Screaming Frog SEO Spider to find duplicate titles, missing descriptions, noindex rules and hreflang errors. Use Meta's Sharing Debugger for Open Graph previews.


More SEO guides


About the author

Christoph Olivier Christoph Olivier is the founder of CO Consulting and a fractional CMO who has managed millions of dollars in ad spend and built a combined audience of over a million followers across social platforms. He works with 7- and 8-figure businesses, primarily in tax, M&A, consulting, real estate investing, capital raising, and financial services. His edge is a practitioner’s command of every major marketing channel, theory and execution, backed by the original marketing data reports he publishes here on CO Consulting.

Follow: YouTube · Instagram · LinkedIn

Work with CO Consulting

Get a free strategy call for your business

Share where you want to grow and what is in the way. We will review it and follow up to book a call with Christoph Olivier.

No guarantees, no hard sell. Your details stay private.

Free strategy call

Want marketing that brings in qualified clients?

Tell us about your business and goals. We will follow up to schedule a call with Christoph Olivier.

No guarantees, no hard sell. Just an honest look at what would move the needle.