Dave Tips

Tips for computers and the internet. How to, tips, tricks and resources for computers and the web.

Tuesday, July 1, 2008

Pretty Facebook Sharing

When someone shares a page on Facebook, the webmaster can specify the title, the description and the default thumbnail image.

The title doesn't have to be the same as the the page's title tag, and is specified with:

<meta name="title" content="different page title"/>

The description is taken from the standard description meta tag:

<meta name="description" content="page description"/>

The thumbnail used for Facebook sharing, and other places too, can be specified with:

<link rel="image_src" href="[your thumbnail's web address]"/>

Place the code in the head section of the web page replacing "[your thumbnail's web address]" with the URL to your thumbnail image, and both the title and description with what you want to have appear when the item is shared on Facebook.

Labels: ,

9 Comments:

Blogger Fred D said...

Hello David!
Maybe you can help me... I use the share on facebook button under each post but when people share, it won't show the post title and description. Instead, it has the blog title and description. How would you fix that?
(Take a look: www.enroutepourlacoupe.com)
Thanks!

October 2, 2009 10:33 AM  
Blogger David August said...

Fred,
A quick look at one of your post's source code shows you have a few issues, some of which would be caught by an html validator. You have more than one <title> tage which will break many things, facebook sharing is just one of them. You also have not made your blog use a "description" meta tag with the posts description, it uses the blog's description.

How to have you blog automatically make title tags and description tags for each post page is largely dependent on what software you use and how much control you have of the server it is hosted on. Some blog software has plug-ins that will solve these issues, some take much struggle to make it do this.

Best of luck!

October 6, 2009 2:19 AM  
Blogger The London Hound said...

Hi again
I have added the code below in order to get facebook to recogniste my post titles:
meta name="title" content="different page title"/
I can see how this works in terms of - if you want a static piece of text for every post i share
but do you know could i insert in order for it just to take the actual existing title of the post - which facebook doesnt seem to recognise at the moment?

October 9, 2009 4:53 AM  
Blogger David August said...

Specific implementation for your site/s is typically a direct consult, and this post, like most Dave Tips, is about a specific feature in a general case (i.e., beyond just blogger).

For blogger blogs, the code in this post is exactly what is used, with the "content" attribute or image URL changed to the posts specifics using template or layout tags as one can for most blogging software.

Your blog listed in your profile already uses unique-to-each-post-page titles, and when I click the Facebook sharing link, it already seems to use that unique title, the post's description and the first image from the post as the thumbnail. I'm unclear what you are hoping to do beyond that.

October 9, 2009 12:22 PM  
Blogger Ninja Narayana said...

Hi David,

I have the same problem as Fred and have your reply. Can you suggest something specific I can do to remedy this problem?

Thanks

November 23, 2009 10:26 PM  
Blogger David August said...

Hi Ninja,
I'm not sure what specific you seek that isn't covered in my
reply to Fred. Looking at your site specifically and making recommendations is something I do for clients and would be happy to discuss directly with you.

November 24, 2009 1:19 AM  
Blogger fathima said...

hi there! I'm looking for a way to customise my "share on facebook" link, as in use an image as the link like i've done with my "tweet this" link. any suggestions?

February 17, 2010 2:01 PM  
Blogger David August said...

Yes, please read my comment on my post about blogger share on facebook link.

February 18, 2010 12:32 AM  
Anonymous Anonymous said...

Direct. Simple.
NICE!

March 1, 2010 7:50 AM  

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home