How to Add and Display Twitter Cards for Your Blogger Blog
First launched by Twitter in early 2012, Twitter Cards have become a game-changing way to make your blog posts stand out when shared on the platform. Unlike plain text links that show up as basic URLs, these rich media snippets display customized titles, concise descriptions, eye-catching images, and your brand or author’s Twitter handle directly in Twitter timelines. While social media giants like Facebook and Google+ popularized Open Graph meta tags for previews years earlier, Twitter developed its own dedicated card specifications while still aligning with some Open Graph rules for cross-platform consistency. Most WordPress users can set up Twitter Cards with a single plugin, but Blogger blogs require manual code tweaks—so the vast majority of Blogger sites skip this high-impact optimization. Today, we’ll break down exactly how to add and display Twitter Cards for your Blogger blog, focusing on the two most practical card types for most hobby and professional blogs.
What Are Twitter Cards?
Twitter Cards are special meta tags you add to your blog’s HTML code that tell Twitter how to display your content when someone shares a post link. There are 7 official card types, each built for specific content formats:
Official Twitter Card Types
1. **Summary Card**: The default, basic rich snippet with a small thumbnail image alongside your post title, description, and brand links.
2. **Summary Large Image Card**: Identical to the summary card, but features a full-width, prominent image at the top of the snippet for better visibility.
3. **Photo Card**: Dedicated to single standalone images.
4. **Gallery Card**: Displays up to 4 gallery images in the preview.
5. **App Card**: Promotes mobile apps with direct download links.
6. **Player Card**: Embeds audio or video previews.
7. **Product Card**: Optimized for sharing e-commerce product listings.
For most Blogger blogs, only two of these are practical: the standard Summary Card and the eye-catching Summary Large Image Card. We’ll focus on these two easy-to-implement options below.
Customizable Twitter Card Code Snippets for Blogger
Blogger comes with built-in dynamic XML tags and conditional tags that let you automatically pull post-specific data like titles, images, and descriptions without hardcoding every detail. Below are two tested, easy-to-customize snippets for your Blogger theme.
Basic Summary Card Snippet
This snippet will display a standard summary card with a small thumbnail next to your post details, and only loads on individual post pages (not your homepage or archive pages). It also automatically falls back to the first few lines of your post if you don’t fill out a custom meta description for the post.
<b:if cond='data:blog.pageType == "item"'>
<meta content='summary' name='twitter:card'/>
<meta content='@YOURBLOGTWITTER' name='twitter:site'/>
<meta content='@YOURAUTHORTWITTER' name='twitter:creator'/>
<meta expr:content='data:blog.canonicalUrl' name='twitter:url'/>
<meta expr:content='data:blog.homepageUrl' name='twitter:domain'/>
<meta expr:content='data:post.title' name='twitter:title'/>
<meta expr:content='data:blog.postImageThumbnailUrl' name='twitter:image:src'/>
<b:if cond='data:blog.metaDescription'>
<meta expr:content='data:blog.metaDescription' name='twitter:description'/>
<b:else/>
<meta expr:content='data:post.snippet' name='twitter:description'/>
</b:if>
</b:if>
Be sure to replace
@YOURBLOGTWITTER with your blog’s official Twitter handle, and
@YOURAUTHORTWITTER with your personal author handle (you can use the same handle for both if you don’t have separate accounts).
Summary Large Image Card Snippet
This snippet swaps to a large image card exclusively on individual post pages, and uses your post’s featured image first, falls back to a thumbnail if no featured image is set, and even uses your blog’s favicon as a last resort. It also includes standard image dimensions (435px wide by 375px tall) to ensure clean previews, which you can adjust if needed.
<b:if cond='data:blog.pageType == "item"'>
<meta content='summary_large_image' name='twitter:card'/>
<b:else/>
<meta content='summary' name='twitter:card'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<meta expr:content='data:blog.pageTitle' name='twitter:title'/>
<b:else/>
<meta expr:content='data:blog.title' name='twitter:title'/>
</b:if>
<meta expr:content='data:blog.canonicalUrl' name='twitter:url'/>
<meta expr:content='data:blog.homepageUrl' name='twitter:domain'/>
<meta content='@YOURBLOGTWITTER' name='twitter:site'/>
<meta content='@YOURAUTHORTWITTER' name='twitter:creator'/>
<b:if cond='data:blog.metaDescription'>
<meta expr:content='data:blog.metaDescription' name='twitter:description'/>
<b:else/>
<meta expr:content='data:post.snippet' name='twitter:description'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<meta content='435' name='twitter:image:width'/>
<meta content='375' name='twitter:image:height'/>
</b:if>
<b:if cond='data:blog.postImageUrl'>
<meta expr:content='data:blog.postImageUrl' name='twitter:image:src'/>
<b:else/>
<b:if cond='data:blog.postImageThumbnailUrl'>
<meta expr:content='data:blog.postThumbnailUrl' name='twitter:image:src'/>
<b:else/>
<meta expr:content='data:blog.blogspotFaviconUrl' name='twitter:image:src'/>
</b:if>
</b:if>
How to Install the Code to Your Blogger Theme
1. Log into your Blogger dashboard and navigate to
Theme > Edit HTML.
2. Use your browser’s find tool (Ctrl+F or Command+F) to locate the
<head> tag in your theme’s code.
3. Paste your chosen Twitter card snippet directly after the
<head> opening tag.
4. Click
Save Theme to apply the changes.
Test Your Twitter Cards
You don’t need to submit your blog to Twitter to use its cards anymore—just use the official
Twitter Card Validator tool to test any of your post URLs. Paste the link into the tool, and click “Preview Card” to see exactly how your post will look when shared on Twitter.
Two quick pro tips for perfect previews:
- Always fill out a custom meta description for each post to avoid truncated snippets pulled from the start of your post text.
- For large image cards, use high-resolution images (at least 435px wide) to prevent pixelated or blurry previews.
Source



























0 Response to "Menambahkan & Menampilkan Snippet Twitter Cards Untuk Blogger"
Post a Comment