Powered by Blogger.

Recent Tube

Adsense

Advertising

Article

Mobile

Mobile

Mobile

How to include the blog post description when you share on Facebook

This article shows how to make that the description is correctly shown when one of your blog-posts is shared on Facebook.




When you share one of your blog-posts using either the via the "what's on your mind" space on Facebook or the Facebook share button on your blog, you may find that the only information automatically shown is:
  • A picture (hopefully, but not always from the post)
  • The post title
  • The blog URL or the post URL

But many people want the post-description to be included too.

There are two things which you need to do to make sure that this happens correctly.


Step 1: Add search descriptions to your blog-posts

If a post does not have a description, Facebook will sometimes try to estimate one based on the contents. But this is not reliable, and it depends on the blog template you have used, and possibly even on other factors, eg at one stage, Facebook just looked for the the first
(paragraph) tag with at least 120 characters in it - which gave very odd results for some Blogger users. Alternatively it may try to use your post.summary but this also depends on your template.

A more reliable approach is for you to provide the description-text for each post.

For Blogger, the way to do this is described here.

For Wordpress, you need to to use an SEO plugin like SEO Ultimate to do this.

Step 2: Add Open-Graph tags to your template

Some templates already contain code which causes Facebook to estimate the description correctly. But some don't - and some may use two-step methods, eg relying on schema.org tags to imply Open Graph tags.

So, as with descriptions, it's more reliable to ensure you are using the set of tags that Facebook officially supports. These are the Open Graph tags.

You can see how to apply them in Blogger  or there are various plug-ins you can use on Wordpress.

Job Done! Once you have made these two changes, when someone shares your blog on Facebook, your own post-description should be shown. Don't forget to test your changes - as described in the Adding Open Graph tags to Blogger article.


What your readers see

Nothing! People who get to your blog using a web-browser, or who subscribe to your RSS feed or who follow-by email don't see anything different after you have done the steps above.

The only different is when they share a post from your blog in Facebook:  the initial description will come from your Description tag for the the post, not from the overall blog.


What happens for posts that do not have search descriptions

This depends on your blog's template, and on how Facebook is interpreting the information that it provides. You can see what Facebook will do for specific posts using the tag-debugging tool which Facebook provide.

Adding descriptions to old posts is tedious. But if your posts are often shared on Facebook, it may be worthwhile for you to allocate some time each day to edit a few posts LINK and update them with a current description. Provided you don't spend too long working out what the description should say, it should be possible to update 200 posts in a three weeks if you spend ten minutes each day doing just this.

What's more, it is possible that adding descriptions to your posts will make them look more attractive in regular Google search results too, which is A Good Thing if search-traffic matters for your blog.




Related Articles:

How to add a Description meta-tag to posts in Blogger

How to apply Facebook's OpenGraph labels in Blogger

Reasons why SEO and search-traffic don't matter for many blogs

How to install Facebook's Open Graph tags into Blogger

This article shows how to install Facebook's Open Graph tags into Blogger


Why Open Graph 


Neil Patel recently explained on Quick Sprout why having Facebook and Twitter tags installed into your blog is important.

To cut his long story short, if you install them, then when someone shares your blog-post, the shared item looks better. This means that more people are likely to follow the link and/or share it themselves - so your blog gets more traffic, and people think you're more professional and thus credible.

Neil also stated that if you don't use Wordpress, "you�ll need to manually generate meta tags for each page on your site" - but fortunately for Blogger users who are brave enough to edit their template that's not true.   Blogger provides lots of SEO-supportive features these days, and you can easily use them to make OG-tags work on your blog - even if you haven't quite got your head around what OG is - personally it took me months to understand what it was all about.

The following sections have more details about how to do this.


How to install Facebook's Open Graph tags into a blog made with Blogger


Edit your template in the usual way.

1     Tell Google about the namespace:

Find the opening <html  ... statement, and add the Open Graph namespace information to it.   The code to add is
xmlns:og='http://ogp.me/ns#'
and it goes after the existing namespace statements.   For example, my current tag looks like:
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection'
xmlns='http://www.w3.org/1999/xhtml'
xmlns:b='http://www.google.com/2005/gml/b'
xmlns:data='http://www.google.com/2005/gml/data'
xmlns:expr='http://www.google.com/2005/gml/expr'    >

or like this after the line is added:
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection'
xmlns='http://www.w3.org/1999/xhtml'
xmlns:b='http://www.google.com/2005/gml/b'
xmlns:data='http://www.google.com/2005/gml/data'
xmlns:expr='http://www.google.com/2005/gml/expr'
xmlns:og='http://ogp.me/ns#'>


2   Add the Open Graph tags


Find the closing </head> tag.
(Hint:  I often search for just </head   ie without the closing >, in case there's something else in the tag in my template)


Put the following code immediately before it:
<!-- Begin Open Graph metadata --> 
<meta expr:content='&quot;en_US&quot;' property='og:locale'/> <meta expr:content='data:blog.canonicalUrl' property='og:url'/> 
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<meta expr:content='data:blog.pageName' property='og:title'/>
<meta content='article' property='og:type'/>
</b:if> 
<meta expr:content='data:blog.title' property='og:site_name'/> 
<b:if cond='data:blog.postImageThumbnailUrl'>
<meta expr:content='data:blog.postImageThumbnailUrl' property='og:image'/>
<b:else/>
<meta content='
URL-FOR-IMAGE-YOU-WANT-TO-USE-IF-THERE-IS-NOT-A-THUMBNAIL-PHOTO-IN-THE-POST' property='og:image'/>
</b:if>
 
<b:if cond='data:blog.metaDescription'>
<meta expr:content='data:blog.metaDescription' property='og:description'/>
<b:else/>
<!-- Still looking for a way to use the post snippet if there's no description -->
</b:if>
<!-- End Open Graph metadata -->


This code needs to be adapted for your blog.   In particular:
  • en_US
This value is fine if your blog is written in US-English. But if you are writing in UK-English, you may want to change it to en_GB.   

And if you are using a different language altogether, you should change it to the two letter code for that language-territory combination:   see https://developers.facebook.com/docs/internationalization/  for more information about the codes that they support

  • URL-FOR-IMAGE-YOU-WANT-TO-USE-IF-THERE-IS-NOT-A-THUMBNAIL-PHOTO-IN-THE-POST 
Replace this with the web-address of a picture that you want to use if the individual post doesn't have a thumbnail  - perhaps your logo, or a blogger logo.


  • App-ID and Facebook-Profile-ID
If you have got an App-ID associated with your blog, perhaps because you signed up to use Facebook commenting with it, then you may also want to add the following statements, just before  the "<!-- End Open Graph metadata -->"
<meta content='App-ID' property='fb:app_id'/>
<meta content='Facebook-Profile-ID' property='fb:admins'/>


Of course putting in your own values instead of the ones in red   (I'm assuming that if you knew enough to get an App-ID, then you will know how to find it, and also about the risks associated with linking your Facebook-profile-ID to your blog.)


3    Check it's complete:

Preview the template changes to make sure that they've worked, and then save them.




Troubleshooting


Testing the OG tags

Facebook have a tool that you can use to see what values the OG tags in your blog have.
It is found here: https://developers.facebook.com/tools/debug

Enter the URL of one of the posts from your blog and click Debug to see the OG tags which Facebook finds for it.



Descriptions

The Descriptions tag will only work if you have Search-descriptions on (Option > Search > Meta-tags > Enabled), and have entered a search description for each post using the post-editor.   I had hoped to be able to use post.snippet when this wasn't available, but have not been able to work out the correct syntax to do this.

Pictures

Facebook would like you to use an image that's at least 200x200 as your posts's thumbnail image or as the default image to use for posts that don't have one.

If the picture that you use is smaller than this, they do appear to use it.

However you will see the following message when you use a debugging tool to look at what tags Facebook is reading from your site:
og:image should be larger
Provided og:image is not big enough. Please use an image that's at least 200x200 px. Image 'http://3.bp.blogspot.com/XXX.png' will be used instead.




Related Articles:


How to add Twitter-Cards to Blogger - these are the Twitter equivalent to Open Graph tags

Advantages and disadvantages of editing your Blogger template

Post.thumbnail:   a summary image for a post

How to edit your Blogger template

Linking your blog to the social networks