How to Create Meta Tags for SEO (With Examples)
Title, description, Open Graph, X card, robots and canonical tags, checked against Google's documentation, with titles measured by pixel width, plus a mistake we found on this very page: its examples were live tags that told crawlers noindex.
The Title Tag
The <title> element is the main source Google uses for a result's title link, though Google may rewrite it, for example when it is very long, stuffed with keywords or the same on many pages. Google's guidance asks for a unique, descriptive, concise title per page and does not set a character limit; long titles are simply truncated on screen.
<title>CSS Box Shadow Generator: Live Preview, Copy the Code | UDT</title>
Truncation is about pixel width, not characters. In Chromium, 60 lower-case i's at 20px Arial measure 267px while 60 capital W's measure 1,133px. We measured all 783 titles on this site the same way (Liberation Sans, which has Arial's widths): 223 are over 60 characters, but 45 of those still fit within 600px. Use a pixel-based preview rather than a character count.
The Meta Description
Google may show the meta description as the snippet when it describes the page better than on-page text; it often picks text from the page instead, matched to the query. Google sets no length limit; snippets are cut to fit the device. Write one specific sentence or two about what the page gives the reader, unique per page.
<meta name="description" content="Adjust offset, blur, spread and colour with a live preview, then copy the CSS. Runs in your browser.">
Open Graph and X Cards
Open Graph tags control link previews on Facebook, LinkedIn, Slack and many others. Meta recommends images of at least 1200ร630 for the large preview. X reads its own twitter: tags and falls back to the Open Graph title, description and image when they are missing, so most pages need only twitter:card on top of Open Graph.
<meta property="og:title" content="CSS Box Shadow Generator">
<meta property="og:description" content="Build box shadows visually and copy the code.">
<meta property="og:image" content="https://example.com/og/box-shadow.png">
<meta property="og:url" content="https://example.com/tools/box-shadow/">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
Robots and Canonical Tags
Pages are indexable by default, so <meta name="robots" content="index, follow"> does nothing and can be left out. Use noindex only on pages that should stay out of search. A canonical link names the preferred URL among duplicates; Google treats it as a strong hint, not a command. Both belong in <head>.
<meta name="robots" content="noindex">
<link rel="canonical" href="https://example.com/page/">
A Mistake We Found on This Page
Until October 13, 2026 this guide printed those examples as real tags inside a paragraph. Browsers parse such tags wherever they appear: Chromium's DOM for this page contained a live <meta name="robots" content="noindex, nofollow"> and a canonical link pointing at example.com, and the page has not been indexed. We cannot prove the two are connected, but Google documents that it reads robots meta tags and canonical links, so a guide about meta tags was telling crawlers not to index itself. A scan of our whole site found six more pages with live <link>, <head> or <meta> tags in their text, one of them loading a font stylesheet from Google. All are escaped now, and a build check blocks new ones. If you write about HTML, check that your examples are escaped: view the rendered DOM, not the source.
The Meta Tag Preview shows how a title and description will look in a search result and in social previews before you publish.
Frequently Asked Questions
What meta tags do I need for SEO?
How long should a meta description be?
Do meta tags affect SEO ranking?
- [1]Google Search Central, Influencing your title links in search results, checked Oct 13, 2026 โ
- [2]Google Search Central, Control your snippets in search results (meta description), checked Oct 13, 2026 โ
- [3]Google Search Central, Meta tags and attributes that Google supports โ
- [4]Google Search Central, Robots meta tag specifications โ
- [5]Google Search Central, How to specify a canonical URL โ
- [6]The Open Graph protocol โ
- [7]X Developer Platform, Cards markup (fallback to Open Graph) โ
- [8]Meta for Developers, Sharing best practices (image size) โ
