Meta Tag Generator
Generate SEO, Open Graph and Twitter Card meta tags for your page, with the ones that matter separated from the ones that no longer do.
A title containing a closing title tag ended the title
The generator escaped the double quote and nothing else — exactly the right instinct
for a content="…" attribute, and not enough for the element in between
the tags. Six awkward strings, run through both the old escaping and the new one,
then read back with a real HTML parser rather than by eye:
| Typed | Title came back as | Attribute came back as | Now |
|---|---|---|---|
Tom & Jerry | unchanged | unchanged | unchanged |
Fish & chips | Fish & chips | Fish & chips | unchanged |
Read </title> now | Read | unchanged | unchanged |
5 < 6 and 7 > 6 | unchanged | unchanged | unchanged |
He said "hi" | unchanged | unchanged | unchanged |
Sale: 50% off <b>everything</b> | unchanged | unchanged | unchanged |
Given Read </title> now as a title, the title of the resulting
document is Read — one word. Everything from that
closing tag onward became loose text in the head. Rare on purpose rather than rare by accident: anyone writing about HTML hits
it, and the tool meant to generate correct markup is a poor place to find out.
The other break is quieter and affects both positions. Titles and content
attributes both decode character references, so a description written as
Fish & chips — because the author wanted those characters
on the page — came back as Fish & chips. Nothing errors,
no parser complains, the description is simply not the one that was written.
Escaping the ampersand first, then the brackets and the quote, fixes both. The order is not decoration: replacing the brackets first would leave their output for the ampersand rule to escape a second time, and a bracket would arrive on the page as visible text.
What the angle brackets turned out not to need
This is the opposite of what you would guess, which is why it is worth recording.
A title containing <b>everything</b> was already safe. The
content of a title element is not parsed as markup — only its own closing tag ends
it — so the tag came through as text. A less-than sign in a content attribute was
safe too, because it means nothing inside an attribute value. Of the
6 strings above, only 2 broke in the
title and one in the attribute.
They are escaped now anyway. A rule with two exceptions in it is worse than a rule, and escaping them costs nothing.
Three of the four Twitter tags are saying it twice
A card reader falls back to the Open Graph tags when the Twitter ones are absent, so most of the Twitter block repeats what has already been said a few lines above.
| Tag | Open Graph equivalent | |
|---|---|---|
twitter:card | none | the one you cannot delete |
twitter:title | og:title | duplicate |
twitter:description | og:description | duplicate |
twitter:image | og:image | duplicate |
3 of the 4 say nothing new.
twitter:card is the exception: it chooses the shape of the
card, and Open Graph has no equivalent.
It follows from whether you gave an image — a large card with one, a small one without.
They are still emitted, because some scrapers read only the twitter:
names and the cost is three lines. Worth knowing they are three lines of insurance
rather than three lines of requirement — and worth knowing which one of the four you
cannot remove.
A field you leave blank emits no tag at all, rather than an empty one for a crawler to puzzle over.
How to use
- Enter your page title, description and canonical URL.
- Add an image for the social sharing preview.
- Copy the generated tags into your page head.
- Test the result with a social debugger before announcing anything.
- Skip the tags that no longer do anything — they are noise.
Frequently asked questions
Which meta tags actually matter?
Title, description, viewport, charset and canonical, plus the Open Graph set for social sharing. That is close to the entire list worth having. A great many tags found in older templates and tutorials do nothing whatever and simply add weight to every page.
Does the keywords meta tag do anything?
No. Google stopped using it well over a decade ago because it was abused into meaninglessness, and the other major engines followed. It is entirely harmless and entirely pointless, and it still turns up in generated templates and boilerplate to this day.
What is Open Graph for?
Controlling how your page appears when somebody shares it — the title, description and image in the preview card. Without it, platforms guess from the page content and usually guess badly. It originated at Facebook and is now honoured broadly, including by most messaging apps.
What size should the social sharing image be?
1200 by 630 pixels is the widely supported standard and produces a large card on most platforms. Smaller images may be reduced to a thumbnail or ignored entirely. The image must sit at an absolute URL and be publicly reachable, which is a common oversight on staging sites.
Why has my link preview not updated?
Because platforms cache preview data aggressively, often for days at a time. Facebook and LinkedIn both provide a debugging tool that forces a fresh fetch, and using it is generally the only way to see your change reflected promptly.
Do I still need Twitter Card tags?
Largely not, since Open Graph is used as a fallback and covers the great majority of cases. A specific card type tag is worth adding when you want a particular layout, but duplicating every value across both vocabularies is unnecessary duplication.
What is the canonical tag for?
Telling search engines which URL is the authoritative version when the same content is reachable at several addresses — with tracking parameters, with and without a trailing slash, or across www and bare domains. It consolidates ranking signals that would otherwise be split.
🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.