Skip to main content

Blogger & Twitter card previews

 So, there was a report in Blogger Help Community which is what made me write this down. 

This is in correlation with Blogger & Facebook OG Object debugger. The report was that Blogger blogs doesn't show preview in Twitter card validator.

So, I went ahead and tried previewing one of my blog posts and I got the following,



Therefore, I tweeted the same link which is here and it didn't show any preview. 

Hence, I concluded not just the validator, the whole twitter stopped scraping my open graph information. Therefore, I made a small research and added a tag in my template.

Please follow instructions below,

  1. Go to https://blogger.com > Themes
  2. Click on the three dot menu near "My Themes" and choose Edit HTML
  3. In the appearing page, press Ctrl + F and find the below code,
    <b:include data='blog' name='all-head-content'/>
  4. Right after that code, paste the following code,
    <meta name="twitter:card" content="summary" />
  5. So, it should look like,
    <b:include data='blog' name='all-head-content'/>
    <meta name="twitter:card" content="summary"/>
  6. Once done, click on the floppy icon in the top right which indicates "Save"

Once I have added the above code and after a couple of tries, the card validator finally scraped my URLs.


So did the tweet too as shown below,


Thus, by adding one line of code we can make twitter scrape all our OG tags. However, this content in the meta tag has one other option. 

summary_large_image

<meta name="twitter:card" content="summary_large_image"/>

So, when you add this as content instead of summary, you will get a nice big image preview as shown below,


So, if you want to learn more about twitter cards to optimise your blog related to twitter previews, please read this documentation here.

Comments

  1. I just wish i knew how to get on this pg

    ReplyDelete
    Replies
    1. To this page as in the blog or Twitter card validator?



      If it is blog, please go to this URL -> https://howtoblog.krishnainfotron.com



      If it is Twitter card validator, please go to this URL -> https://cards-dev.twitter.com/validator

      Hope that helps.

      Delete
  2. Of course! The "summary_large_image". Really cool trick . Thank you for sharing!

    ReplyDelete
    Replies
    1. Thanks for reading through :-) and am happy it helped. Happy blogging :-)

      Delete
  3. Thank you so much for sharing! This was super helpful and it worked perfectly for me.

    ReplyDelete

Post a Comment

People also read,

How to secure your Google account and Blogger blog?

As a part of contributions to NCSAM, I am writing this article down on what all should we be aware of with respect to Google's security aspect and how to make sure your blog stays yours forever. What is NCSAM? It's National Cyber Security Awareness Month which is observed during the month of October every year in America. However, we all know cyber security is a world topic and is not limited to just the USA. So let me give some tips with respect to keeping the Google account safe and Blogger blogs safe from hackers. As I secure my account, I hope you people catch up too. In this blog post, I am going to tell about the following, Securing your Google account. Securing your Blogger blog. Securing your Google account Since Blogger is also part of your Google account, let's first see what all we need to do to keep our Google account safe. Don't share your password to anyone. Keep changing your password every 60 - 90 days. Make sure your password is str

Blogger Tweak - Open external links in new tab automatically

So, once upon a time, a really long while ago, I tried to customise and recreate a Blogger template which is not available anymore, but there's one thing I remember about it. I had a jQuery code written to make all the external links open in new tab. I also thought, it's about time I revive that idea and write a more intact code and here we go.  So, there are two things to do.  Add Javascript code that detects external links and opens them in new tab. Add a CSS code to let users know that a particular link is going to be opened in new tab. Adding a javascript code Please follow the instructions below, Go to https://blogger.com  dashboard Navigate to Themes > click the down arrow near "Customize" and then click on Edit HTML. Now scroll to the very end and paste the following code just before </body> tag. <script type='text/javascript'> document.body.addEventListener(&quot;mousedown&quot;,function(event){       if(event.target.tagNa

Blogger HTTPS for custom domain and Cloudflare

In BHF, there was a recent issue related to cloudflare where the browser screams the site is a phishing site. So I thought of writing up how does a service like cloudflare affect your blogger blog. What is Cloudflare? Well we have that written all over Wikipedia: Cloudflare . Let's go on with why Blogger users look for Cloudflare. Anciently Blogger users used Cloudflare for one simple reason. HTTPS for custom domains. So what happens when you introduce Cloudflare into your domain? DNS Redirect. Your custom domain will be configured with the proxy info provided by Cloudflare and when the request is hit, DNS redirect happens. DNS redirect is bad for the site's health. A number of reasons, but the most important is that some browsers, when it detects a DNS redirection, it thinks that it is a phishing site. What is a DNS redirect? I am trying to explain this in easy terms. I'll try not to be too technical. When a custom domain URL is hit, usually the domain reques