How To Integrate Twitter Cards With Blogger For Social Meta Data

July 17th, 2012

With the shift of the web towards the semantic web and the focus being on data connectivity and its co relevant display. The web is giving priority to Rich Snippets, HTML 5, microformats and schemas.

Twitter last month announced Twitter cards that make it possible to attach media experiences to Tweets that link to your content. Simply add a few lines of HTML to your webpages, and users who Tweet links to your content will have a “card” added to the Tweet that’s visible to all of their followers.

There are 3 card types that can be attached to Tweets, each of which has a beautiful consumption experience built for Twitter’s web and mobile clients:

· summary: The default card, which includes a title, description, thumbnail image, and Twitter account attribution.

· photo: A Tweet sized photo card.

· player: A Tweet sized video/audio/media player card.

The summary card can be used for many kinds of web content, from blog posts and news articles, to products and restaurants.

The card is designed to give the reader a preview of the content before clicking through to your website just like a snippet.

You’ll notice that this card makes use of all of the properties described in the previous section: URL, title, description, and image.

Card Property
Should be set to a value of
No. If no twitter:card value is
set, we will default to a summary card.
Canonical URL of the card content.
Title should be concise and will
be truncated at 70 characters.
A description that concisely
summarizes the content of the page, as appropriate for presentation within a
Tweet. Do not re-use the title text as the description, or use this field to
describe the general services provided by the website. Description text will
be truncated at the word to 200 characters.
URL to a unique image representing
the content of the page. Do not use a generic image such as your website
logo, author photo, or other image that spans multiple pages. Images larger
than 120x120px will be resized and cropped square based on longest dimension.
Images smaller than 60x60px will not be shown.

If any required fields are omitted, the card may not be shown in the Tweet. Note that the card displays clear attribution for both the website and content creator. Here’s the full HTML for the card above:

<meta name=”twitter:card” content=”summary”>
<meta name=”twitter:site” content=”@nytimes”>
<meta name=”twitter:creator” content=”@SarahMaslinNir”>
<meta name=”twitter:url” content=””>
<meta name=”twitter:title” content=”Parade of Fans for Houston’s Funeral”>
<meta name=”twitter:description” content=”NEWARK – The guest list and parade of limousines with celebrities emerging from them seemed more suited to a red carpet event in Hollywood or New York than than a gritty stretch of Sussex Avenue near the former site of the James M. Baxter Terrace public housing project here.”>
<meta name=”twitter:image” content=””>
After this code is added the expanded tweet will appear as follows on Twitter when that particular link is shared:

This kind of  code can be easily added to WordPress for each blogpost .

In order to add this code for each blogpost in Blogger, follow the following instructions:

1. Login to Blogger account.

2. Navigate to Design > Edit HTML

3. Click on Download Full Template for your security purpose.

4. Check the Expand Widget Templates box then..

5. Add the relevant code in the <head> section of your Blogger template. Enter the following code in the head section i.e above</head>

6. Click on the Save Template button

7. To check your description you can use the view source in your browser once you have navigated to the post page

This is an example code for 2 blogposts on my blog:



<b:if cond=’data:blog.url == &quot;;’>

<meta name=’twitter:card’ value=’summary’/>

<meta name=’twitter:site’ value=’@webprotech’/>

<meta name=’twitter:creator’ value=’@webprotech’/>

<meta name=’twitter:url’ value=’’/>

<meta name=’twitter:title’ value=’Empower Your Website To Claim Your Search Engine Presence’/>

<meta name=’twitter:description’ value=’ SEO though a branch of online marketing has its own purpose and identity which is beyond marketing – inbound or outbound. All about the SEO Cocktail ‘/>

<meta name=’twitter:image’ value=’’/>


<b:if cond=’data:blog.url == &quot;;’>

<meta name=’twitter:card’ value=’summary’/>

<meta name=’twitter:site’ value=’@webprotech’/>

<meta name=’twitter:creator’ value=’@webprotech’/>

<meta name=’twitter:url’ value=’’/>

<meta name=’twitter:title’ value=’How The Semantic Web, HTML5, Microformats And SEO Are Inter-Linked’/>

<meta name=’twitter:description’ value=’ HTML5 and microformats helping the representation of content as data for the semantic web ‘/>

<meta name=’twitter:image’ value=’’/>


Twitter is in the process of bringing this new content preview experience to users on Twitter. To participate in the program, you should apply to participate. As Twitter rolls out this new feature to users and publishers, they are looking for sites with great content and those that drive active discussion and activity on Twitter.

About The Author

Founder of WebPro Technologies a Web solutions company based in India which focuses on building quality web presence for businesses. Bharati Ahuja is a SEO Trainer and speaker, Web Entrepreneur, Blog Writer, Internet Marketing Consultant.


Digital Marketing Agency India