Open Graph
Twitter cards on X: tags and testing
Quick answer
Twitter cards control how your links look on X. Add a twitter:card tag set to summary_large_image for a wide image preview; X falls back to your Open Graph title, description and image when the twitter tags are missing. Use an image with a 2:1 or 1.91:1 ratio, at least 300 by 157 pixels, and under 5 MB.
The tags
| Tag | Needed? | Notes |
|---|---|---|
| twitter:card | Yes | summary_large_image for a wide image, summary for a small square |
| twitter:title | Optional | Falls back to og:title |
| twitter:description | Optional | Falls back to og:description |
| twitter:image | Optional | Falls back to og:image |
| twitter:image:alt | Recommended | Alt text for the preview image |
| twitter:site | Optional | Your site's account handle |
Because of the fallbacks, a site with good Open Graph tags needs only one extra line: <meta name="twitter:card" content="summary_large_image">. Without it, X shows the small summary card or none at all.
Card types
Image sizing
The large image card crops toward 2:1. A 1200 by 630 Open Graph image works well if the important content sits in the centre; see the safe zone in Open Graph image size. Keep the file under 5 MB and use JPG, PNG or WEBP. Animated GIFs show only the first frame.
Testing
View source
Confirm one twitter:card tag and a single og:image.
Check the image loads publicly
Open it in a private window over https.
Post a test
X's standalone card validator no longer previews cards, so draft a post with the link, or share it from a test account, and look at the preview in the composer.
Re-share after changes
X caches cards for a while; new posts pick up changes sooner than old ones.
In WordPress
SEO plugins usually output twitter tags alongside Open Graph and let you choose the default card type. If your share plugin also prints them, you may get two twitter:card tags; keep one source. The old product images on this domain showed Open Graph and twitter card settings side by side, a reminder that the two have always been configured together.
Questions
Do I need Twitter card tags if I have Open Graph tags?
You need twitter:card. The title, description and image fall back to your Open Graph tags.
What image size is best for a Twitter card?
A wide image around 1200 by 630 or 1200 by 600, with the key content centred, under 5 MB.
How do I test a Twitter card now?
Paste the link into the X composer or a test post and check the preview.
Hannah Voss, Editor. Checks every guide against a working WordPress install and the networks' current documentation. Last reviewed September 2026.
Related guides
- Adding Open Graph tags in WordPressAdd Open Graph tags to WordPress with an SEO plugin or theme code: the four required tags, image tags, per-post overrides, and how to avoid duplicate tags.3 min read
- Open Graph image size: 1200 by 630 and the safe zoneThe right Open Graph image size is 1200 by 630 pixels at a 1.91:1 ratio. Minimums, file limits, formats, and a centre safe zone for square crops.3 min read
- Click to tweet boxes: how to build them in WordPressBuild a click to tweet box in WordPress with a block or a simple link. Wording, the 280 character limit, how links are counted, and how to style the quote.3 min read