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.
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
-
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.
-
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.
-
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.
-
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.
-
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.
-
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?
How long should a title be?
Do I need Twitter tags as well as Open Graph?
Why is my share preview showing the wrong image?
Should every page have a canonical tag?
Tools used in this guide
All tools →- Meta Tag Generator Generate the meta, Open Graph and Twitter tags for a page. In your browser
- Character Counter Count characters with and without spaces, live as you type. In your browser
- HTML Entity Encoder and Decoder Escape HTML special characters, or decode entities back. In your browser
- URL Parser Split a URL into its scheme, host, path, query and fragment. In your browser
- Slug Generator Turn any title into a clean, URL-safe slug. In your browser
- robots.txt Generator Build a valid robots.txt, with or without the AI crawlers. In your browser
Related guides
All guides →Last reviewed .