How-to guide

How to Write Meta Tags

Four tags carry almost all the weight: title, meta description, canonical and og:image. Write the title for the search result rather than for the page, keep the description to what would make someone click, point the canonical at the page itself, and supply an absolute 1200×630 image. Almost everything else in a typical head block is optional.

Meta Tag Generator

Generate the meta, Open Graph and Twitter tags for a page.

Open the tool

A head block accumulates tags nobody has questioned in years. Keywords, revisit-after, author, a dozen bits of Dublin Core — none of them do anything for search. Meanwhile the four that do the work are often the ones written last and least carefully.

It is worth separating the two audiences. The title and description are advertising copy for a search result. The Open Graph tags are advertising copy for a link shared in a message or a feed. They can differ, and often should.

Step by step

  1. Write the title for the result, not the page

    It is the headline of a search listing. Lead with what the page does, in the words someone would search for. Around 50 to 60 characters usually displays in full — though the real limit is pixel width, so wide capitals are cut sooner.

  2. Write a description that earns the click

    It is not a ranking factor and it is displayed, which makes it advertising copy rather than metadata. Say what the page gives them and why it is worth opening. Around 140 to 160 characters, and unique on every page — duplicates are a cannibalisation signal.

  3. Add a self-referencing canonical

    Every indexable page should point its canonical at its own absolute URL. That consolidates any variants — tracking parameters, trailing slashes, http and https — onto one address rather than leaving the choice to a crawler.

  4. Set the Open Graph tags for sharing

    og:title, og:description, og:url, og:type and og:image cover Facebook, LinkedIn, WhatsApp, Slack and Discord. X falls back to Open Graph, so the only Twitter tag genuinely worth setting is twitter:card to select the large-image layout.

  5. Supply an absolute 1200 by 630 image

    That is the 1.91:1 ratio the large-image card expects. The URL must be absolute — a crawler fetching your page from elsewhere cannot resolve a relative path, which is the most common reason a preview shows no image.

  6. Leave out the tags that do nothing

    The keywords tag has been ignored since 2009. So have revisit-after, rating and most author tags. They add bytes and imply a level of care the rest of the page then has to live up to.

Example

The four that matter, plus the Open Graph set that controls how a shared link looks.

Minimum worth writing

<title>…</title>
<meta name="description" content="…">
<link rel="canonical" href="https://…">
<meta property="og:title" content="…">
<meta property="og:description" content="…">
<meta property="og:url" content="https://…">
<meta property="og:image" content="https://…">
<meta name="twitter:card" content="summary_large_image">

Not worth writing

<meta name="keywords" content="…">
<meta name="revisit-after" content="7 days">
<meta name="rating" content="general">
<meta name="distribution" content="global">

Ignored by every major search engine.

Frequently asked questions

Is the meta description a ranking factor?
No, and it has not been for a long time. It is displayed, which makes it worth writing well — a better description raises click-through, and that is where the value is. Search engines also often replace it with text from the page when they judge that a better match.
How long should a title be?
Around 50 to 60 characters usually displays in full, but the limit is pixel width rather than character count, so a title of wide capitals truncates sooner than one of narrow lowercase. Write for a person and check the length afterwards.
Do I need Twitter tags as well as Open Graph?
Mostly no. X falls back to Open Graph when the Twitter equivalents are absent, so og:title and og:description are enough. The exception is twitter:card, which selects the large-image layout and has no Open Graph equivalent.
Why is my share preview showing the wrong image?
The platform cached it. Social networks hold previews for a long time and changing the tags does not clear the cache — use the platform's own sharing debugger to force a re-fetch.
Should every page have a canonical tag?
Every indexable page, pointing at its own absolute URL. That is what consolidates tracking parameters and other variants onto one address. Pages that should not be indexed want a noindex robots tag instead.

Tools used in this guide

All tools →
All guides →

Last reviewed .