Diperbarui: 2026-08-30
Cara Memposting Tautan di Twitter dengan Gambar

Twitter Card META Tags

There are four current types of Twitter/X Cards: summary, summary_large_image, player, and app. The summary card shows a small thumbnail alongside your title and description; summary_large_image displays a large hero image above the text and is what most publishers use for link previews; player embeds inline audio or video; app links directly to an iOS/Android app listing. All META tag name attributes are prefixed with twitter:, and that hasn’t changed since the platform’s 2023 rebrand from Twitter to X — X still reads the same twitter:-prefixed tags.

Generic META Tags

META tags you would use in all card cases include:

  • twitter:card – The type of card to be created: summary, summary_large_image, player, or app.
  • twitter:url – The URL that should be used for the card. This will likely be the same URL as the page’s canonical link.
  • twitter:title – The title as it should display in the Twitter Card.
  • twitter:description – A 200 character summary of the content at the given URL.
  • twitter:image – A representative image URL for the content. In many cases, simply providing your logo’s URL will be just fine, though a dedicated image sized around 1200×675 works best for the summary_large_image type.

Each of these items gets its own META tag, so the Twitter Card META tags for this page would look like this:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="https://postrss.com">
<meta name="twitter:title" content="How To Post a Link on Twitter With Image">
<meta name="twitter:description" content="How To Post a Link on Twitter With Image.">
<meta name="twitter:image:src" content="https://postrss.com/wp-content/uploads/2014/01/mainslide1.jpg">

Source Code for WordPress

Source code for WordPress tags for Twitter for showing an image alongside links at posts:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="<?php echo get_permalink($ID); ?>">
<meta name="twitter:title" content="<?php echo get_the_title($ID); ?>">
<meta name="twitter:description" content="<?php echo mb_substr($content,0,120); ?>">
<meta name="twitter:image:src" content="<?php $ID = $wp_query->post->ID; $image = wp_get_attachment_image_src( get_post_thumbnail_id( $ID ),'full'); echo $image[0]; ?>">

How to Test Your Card Preview

X retired its official Card Validator tool in 2022, so there’s no first-party way to preview a card without actually posting it. The most reliable check is to post the link on X yourself (a draft or unlisted post works if your account/workflow allows one) and look at the rendered preview directly. Several independent, free card-preview tools are also available online if you’d rather not post a test link publicly — search for “Twitter Card preview tool” and cross-check results against what your page’s own twitter: tags actually say, since third-party tools vary in how current their scraping is.

How This Applies to Automated Posting

When PostRSS automatically posts a new article from your RSS feed to X, the platform generates the link preview from whatever twitter: (or fallback Open Graph) tags exist on your page at the moment X’s crawler fetches it. Setting up correct twitter:card, twitter:title, and twitter:image tags on your website using the code above ensures your automated posts also get a proper image preview instead of a bare link.

Frequently Asked Questions

Do I need both Open Graph and Twitter Card tags, or does one cover both?

X will fall back to your Open Graph tags (og:title, og:image, og:description) if dedicated twitter: tags aren’t present, so a page with solid OG tags alone will usually still get a reasonable preview. Adding twitter:card explicitly is what unlocks the larger summary_large_image layout specifically, though, so it’s worth setting even if your OG tags are already in place.

What image size should I use for summary_large_image?

X recommends an image around 1200×675 pixels (roughly a 1.91:1 aspect ratio), similar to Facebook’s Open Graph recommendation, so a single well-sized image can often serve both platforms.

Why is my Twitter Card still showing an old image after I updated it?

Like Facebook, X caches card data per URL for a period after it’s first scraped. Posting the link again, or waiting for the cache to expire, will typically pick up the updated image.

Menu
x
PostRSS - Platform Otomatisasi RSS Feed & Alat Auto-Posting
Ikhtisar Privasi

Situs web ini menggunakan cookie agar kami dapat memberikan pengalaman pengguna terbaik bagi Anda. Informasi cookie disimpan di browser Anda dan menjalankan fungsi seperti mengenali Anda saat Anda kembali ke situs web kami serta membantu tim kami memahami bagian situs web mana yang menurut Anda paling menarik dan bermanfaat.