Thursday, May 21, 2020

Getting Twitter Cards from Blogger Posts


Twitter card / previews not showing up from Blogger posts? Try this.

Backup your blog first.

Go to Templates and Edit HTML.

Control (PC) or Command (Mac) - F to find

<b:includable id='post' var='post'>


Then paste in:

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

<meta content='@yournamehere' name='twitter:site'/

<meta content='@yournamehere' name='twitter:creator'/

<meta content='www.yoursitehere.com' name='twitter:domain'/

<meta expr:content='data:post.firstImageUrl' name='twitter:image:src'/

<meta expr:content='data:post.title' name='twitter:title'/

<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>

<meta expr:content='data:post.sharePostUrl' name='twitter:url'/>


Replace @yournamehere with your Twitter name, then replace your website here with your full blogger site name, including the https://

Click save.

Go to yu blog and copy a post link, not the home address.

Then go to https://cards-dev.twitter.com/validator  and paste in your blog post url. click 'Preview Card' and it should pull correctly. Might take a minute, too as mine did the first time.

I've been sticking with Blogger for my personal / part-time consulting site. It's where I started and there's some nostalgia in there, I guess. There are more robust options out there, but it keeps working with some mods like this on occasion. 

I do wonder though when might a major refit be coming with a WordPress, Squarespace or Wix style functionality. 

We'll see. 

Keep tinkering.

AP

#blogger #twitter #twitterValidator