How to Add Facebook Comments to a Blog and Improve Search Ranking

Facebook for Blog Comments
Facebook for Blog Comments

Perhaps by now you have seen a few blogs using Facebook comments. If you have not seen it yet, you can witness it in action here on “SEO and Social Media Marketing Blog”. Go ahead and look, if you must … but we will get to that part anyway.

When I recently added Facebook comments I was so excited about the increased commenting and Facebook sharing that I knew others would want to know more about it, too.

I want to tell you about some really useful features of this free service, including SEO (search engine optimization) benefits, enhanced user-experience, increased social interaction, and more. Then, I will give you step-by-step instructions on how to add Facebook comments to your blog (or any website).

So, let’s get started. Before I give you the step-by-step “How To”, I want to explain some huge benefits. After all, it really doesn’t make sense to do this if you don’t know why, or how it can benefit your website.

Maybe I should have split this into two articles, but if you are just here for the installation, jump to the installation now. It could get a little geeky around here for some people, but haven’t you ever really wanted to know what makes geeks tick? Read on my “non-geek” friends. I have some love here for you, too!

Facebook Comments Search Engine Ranking Benefit

It is not a secret that Google and Bing use information from social media for ranking websites. Since December of last year, it has been speculated that one of the strongest individual signals Google uses is the number of Facebook shares. That is, the number of times somebody actually shares your website on Facebook. It is really hard to qualify this, and there is a lot of contention in the matter.

Regardless of any potential direct SEO value, when you use Facebook comments, it greatly increases the probability of people sharing your blog on Facebook. Of course, they don’t have to share it on their Facebook wall when they comment, but the option is selected by default. The way I see it is that unless I am ashamed of something I am reading, I will usually share my comments on Facebook, along with the originating article. Other people seem to react the same way, and since the option is so simple and right there in front of them, is it easy to see why it will increase the probability of a blog article receiving more Facebook shares. Facebook shares can lead to blog posts, Twitter conversations, and a whole list of other possibilities. So, in the end, the SEO benefits can come in many forms.

Although Google cannot see much of the information shared on Facebook, there is still a lot of reason to suspect that the crawler can find at least some of it. In case you are doubtful of the value of Facebook sharing to SEO, here are some influential third party references on the matter:

Below is a video from the third article in the list. If you don’t have time for it, just know that Facebook sharing can potentially benefit your search engine rankings, and that Facebook comments are a huge step toward a more interactive user experience … another big step toward good SEO.

Let’s not forget that in addition to the benefit of Google and Bing using Facebook sharing in their rankings, it also opens the floodgates to more people seeing your website. That means more people to potentially share it along to their friends. Oh, it all gets so exponential and mathematical … I think I may need another cigarette!

Facebook Comments Enhance User Experience

User experience sounds so cliché and empty to me, but you understand the notion. Making your website easy and familiar is imperative to its success. The end-user is why we all work so hard to make our websites feel easy and familiar, like sweatpants and a pair of flip flops. It has to be comfortable, or people will stop coming back … or coming at all.

On the other hand, if you focus the website on benefiting the end-user, before you know it, that hard work all starts to make a lot of sense. People start blasting it out to all their friends about how they almost peed their shoes when they found the one website on earth that actually smelled like bacon, and rubbed them like a teenager in the back seat of a Camaro.

Add More Nasty Camaro with Facebook!
Add More Nasty Camaro with Facebook!
If you want to call it “User Experience”, go ahead … I am thinking about the party in the yellow Camaro with steamy windows! Then, before I fall asleep, I will paw through the fridge in search of that bacon I smelled. That is how I see “user experience”, and you can flop on my virtual couch any time. It’s comfy, isn’t it?

Here is how Facebook comments improve the user experience: Let’s face it, everybody who ever wrote a blog wants to see comments … even if only to point out a typosnaphical error. They want to know that they didn’t do all that work for nothing. If you are reading this, you probably have a blog, so you know what I mean. The challenge is in making comments an easy and natural response for the people who read your work.

Of course, you could look at it this way: Maybe everybody except you is a lazy, no-good, deadbeat blog lurker who soaks up your hard work, and laughs in your face when they click away to their next victim.

-or-

You could consider that there are a lot of busy people, and even a lot of them who really don’t know much about blogs, or the benefits of participating. They don’t all know the value of getting to know all of those other readers with the same interests. This makes it your job, the blogger, to fix the challenges. You need to make it easy, and natural to leave a comment, and Facebook comments do just that!

Shoe-peeing, Camaro-sweating, bacon-scented, unicorn-kissing, all-you-can-haul-out-the-door-for-a-dollar brilliant content is not always enough. You have to make it so easy that getting up to deal with a bad case of diarrhea can wait just a few more seconds while they shower you with their lovin’ words.

Facebook Comments Increase Social Interaction

With well over half a billion people using Facebook, it is a lot more recognized than your blog. People know how to use it. Facebook is a comfy, cozy, snugly, familiar place for many people. Those Facebookey people are not so shy to communicate on Facebook. They do it all the time. That is what Facebook is there for, and that is also why it is on my blog (and probably on your blog soon).

Facebook comments meet the challenges of familiarity and ease of use like a hungry blogger meets a greasy bacon sandwich. If people aren’t talking to you, and each other, with Facebook comments on your blog, you can believe it … they really just don’t like you, or other people … At All.

Some interesting things to note is that when somebody comments and elects to share it (along with the article) on Facebook, it will appear simultaneously on the blog, and on Facebook. Replies to that person will then be visible to them on their Facebook Wall, as well as a link back to the article.

For those who have their employer set up properly and visible publicly on Facebook, another neat feature is that their title and company Facebook Page link will appear. That can create additional possibilities for business networking. Of course, the user’s Facebook security settings still apply.

How to Add Facebook Comments to a Blog


The list of nice features goes on, but we can chat about that in the comments. That way you can see how neat it really is from a user perspective. Let’s get to the part about how you can add these nifty Facebook comments to your blog. I am going to explain it based on WordPress, but it is similar for other websites.

I looked for a a plugin for this, but I didn’t find one, so I may write a Facebook Comments WordPress Plugin (actually just a relatively simple installation script) if I get the time. The closest plugins I found were to import comments from Facebook notes, but that is not the same thing at all. This is how to actually include and synchronize Facebook comments, likes, and shares on a website.

This is really not very hard, but Facebook’s documentation is so lengthy that it could get confusing if you don’t know what you are looking for. So, I am going to include the links you will need to visit on Facebook, and what to do when you get there.

If you need help, that just makes a good case for why blogs have comments in the first place.

Step One: Create a Facebook Application – This does not mean going to school for web programming, and creating an app is much easier than it sounds. All you have to do is click here, then click on “Set Up New App”, enter an App Name (like the name of your blog), agree to Facebook’s terms, and then fill in a few more easy blanks.

Once you have the app set up, hold onto that info for a bit. You will need the application ID number in the next step.

Relax, you can do this … really. If you get confused, just add your questions in the comments below, and somebody will help you … probably me. If you start feeling a bout of rage coming on, just put down the weapon and ring me up. I will do it for you for a song. Well, actually a song along with some of your money, but not all of it.

Step Two: Load the JavaScript SDK – If that “creating an application” thing sounded hard, this one sounds like having to share a sleeping bag with your mother-in-law. It is actually quite simple. I don’t know why they make it all sound so difficult.

In this step, all you are doing is adding the basic information the application will need for your website, in the format Facebook needs it. It looks daunting to some people, but if you just look at the example, and find where it says “YOUR APP ID” replace it (the letters only) with the ID number you received when you created your app.

You can either go and copy the code on the Facebook Developers JavaScript SDK page, or just use the snippet below. I suggest using the version where it says “Loading the SDK Asynchronously”. You only need the one snippet of code, and this is the one I use here on my blog. Just be sure to put your new app ID where it says “YOUR APP ID” in this code.

Here is the code you will need:

Step Three: Copy and Paste the JavaScript SDK – If my mother is reading this, she is probably going to the kitchen junk drawer for glue. That copy and paste thing drives her guano-crazy. I will handle it for my mom when she gets hot on her blogging career, but for you, this will be a snap! Take that snippet of code from above (edited with your new app id) and open your WordPress Theme Editor. It is right there in that place where you add new blog posts. More specifically at http://YOUR-DOMAIN/wp-admin/theme-editor.php (unless you have some freaky-deaky version of WordPress). This is where you can see a list of your theme files sitting there ready to beat up like a row of red headed boys in pink high-water pants.

Pay Attention and Stop Beating Up the WordPress Redheads
Pay Attention and Stop Beating Up the WordPress Redheads

The precise placement of this code is not a huge issue. You see … this really is easy! I added mine into the “Header (header.php)” file in my theme. It could have a slightly different name, but you have something like that, where it has all of that header-ish kind of stuff. Within that file, you’ll see words like “head”, “body”, “meta”, and a lot of others. I added my “JavaScript SDK” snippet immediately below the “body” tag. You can see where it is in my source code if you like, but just don’t go giving me any “Grandma Guilt” if you don’t like the html comments in my source code. Just search the code for the word “body”. It’s there … you can find it … I have faith in you.

Paste it your code somewhere right around there (or exactly there), but keep that same page open. You still need to shove some more stuff in there.

Step Four: Add Facebook’s “xmlns:fb” Namespace Attribute to Your HTML Tag – That sounds worse than it is, but we want this to be easy. So, while you have that header file opened, look for this: xmlns=”http://www.w3.org/1999/xhtml” and add xmlns:fb=”http://www.facebook.com/2008/fbml” right behind it … well, with a space, of course.

So it should turn out to look like the example below. Just copy it and replace the old one.

Step Five: Add the Open Graph Protocol – I swear these Facebook guys smoke some crazy stuff to make this sound so darn complex. This is just a series of meta tags … little bits of information about your website and the specific pages, so Facebook knows what it needs to know.

Here is the code you need, with very minimal editing if you are using WordPress. All you need to do is edit the parts in CAPITAL LETTERS. You can pretty it up with line breaks and stuff if you like. It really makes no difference in function.

Step Six: Add the Comments Code – Ahh, this is the easy stuff. You are almost done. You need to paste the code below on your website where you want the comments to appear. In your WordPress theme editor, just click to edit “Single Post (single.php)” or the equivalent in your theme. It may be named differently, but don’t let that eat you up. I added it immediately above my existing comments. Just search the file for the word “comments” and you will probably find it really quick.

The only editing you will need to do here is to adjust the width (520 in my example) to the width you want it to appear on your blog, and also the “num_posts” for how many comments you want showing before the “show more comments” link appears to users.

That should do it. Save everything and start enjoying more comments and Facebook shares.

What About WordPress or Disqus Comments?

To me, WordPress’ built-in comments, Disqus comments, Intense Debate, and etcetera are not replaced by Facebook comments, but rather enhanced.

Disqus is Here to Stay
Disqus is Here to Stay

You cannot import your existing blog comments into Facebook (at least for now), and I still enjoy all of the features of Disqus. So I think it makes good sense to keep an existing comments system in place.

I am keeping Disqus right here where people can embed videos, upload photos, and all the other great networking benefits, but I am also pretty excited about the new addition.

Which one will you choose to use to add your take on the matter? If you don’t leave me a comment, I may just think you are a snob, so please redeem yourself! Oh, and give that share button a whirl, unless you are ashamed of me. 😉

More Useful Facebook Articles:
(You didn’t expect me to stop here, did you?)

SEO and Blogs: How Many Blog Posts Should I Have on My Home Page?

Blogging Tip on Posts Per Page
Blogging Tip on Posts Per Page

The question of how many blog posts to display on the home page of a blog is a pretty tough call for a lot of people. After all, it affects the page load time, the number of generated pages in your archive, the number of pages indexed by search engines, and most importantly, the user experience.

What is the best number of blog posts per page? The answer will depend on a number of things, but I want to offer some food for thought, and share what I have experienced.

If you don’t already have a blog, you may want to sit this one out, but if that is the case, I encourage you to read “10 Really Good Reasons to Blog“.

As an SEO guy, I am not always right about every SEO topic. I try my best to keep my percentage of being right pretty high, but even I can get it wrong sometimes. It usually happens because of overlooking the obvious things I should be doing, but conveniently neglect.

The reality about SEO is that sometimes the right answers take a little bit of testing. Some people may call it “tinkering”, but that implies doing it without forethought. My suggestion is to stop “tinkering”, but always be testing. In this instance, I do not suggest making frequent changes, so it is good to make your best guess the first time.

Changing Number of Posts Per Page: Think Ahead!

It was not so long ago that I faced the question of changing the number of blog posts per page, on this blog. I had previously displayed ten articles on the home page and on each archive page. It was not a good idea, but then, I get wrapped up in client work and forget about my own stuff. I am often like a cobbler with barefoot children. Once I got around to this issue of blog posts per page, I was really glad to finally address it. I know that others have this question, and in fact, a friend who writes “Social Media Philanthropy” recently had a poll of his readers to see what they think.

Depending on your blog theme, the number of blog posts on your home page will generally be the same number which will be listed in each of your archive pages, too. I don’t mean the kind of archive like my complete archive where I list all of my articles, but rather the pages that are generated for chronological archiving, tag archiving, and category archiving.

If you do not know exactly what I mean, just click on the “older articles” link at the bottom of this page, click on any tag (), or click on a category (for example Marketing). My blog presently lists a total of five articles for each of these types of generated pages, and then has a link to the next page of posts.

Changing the number of posts per page will change other factors of your website, so it is best to think ahead and not do it too often. I will tell you a bit about what it will change.

Changing Blog Posts Per Page Has Multiple Effects

Let’s think about how a change in the number of posts per page will change other things. When my blog displayed ten posts per page, there was the obvious outcome that each page was longer. It makes sense that the potential for keyword phrase matching in a given search engine index may be higher, because of the lengthier content on each page. It also took a bit longer for each page to load, so that was a downside. Plus, consider how daunting a huge long scrollbar can look to somebody just wanting some quick and easy information.

An even greater downside to having large numbers of posts per page is the much lower number of total pages of the blog. More pages can be a really good thing, but of course not just any pages. You can add pages just by adding a bunch of extra blog tags or categories, too, but it is not recommended.

I am certainly not saying that you should go and set your blog to display two articles per page just to bump up your page count. That could be a bad thing. After all, just consider how many times somebody will want to click to the next page, and how annoying that could be. The rule of thumb is that you have three clicks before you lose somebody. Certainly some blogs are much higher, and some are much lower, but it is really important to keep those readers happily surfing on your awesome wave. You do this by having everything just right … or at least as close as possible.

The most important factor is how it will affect the people reading your blog, and not the search engine indexing. If people like your blog, they are more likely to link to it, subscribe to it, and keep coming back. This should always be the primary consideration, but this really can make a big difference in search engine indexing, too.

Fewer Blog Posts Per Page Means More Indexed Pages

This is something I offer with caution. You do not want to aspire to a bunch of frivolous extra pages in search engines. You want search engines to index valuable, useful, and human-worthy content. That is what search engines want, too.

There is a lot of hype on one side or the other about allowing blog tag archives and category archives to be indexed by search engines. There are multiple easy ways to control this, and I use a (highly modified) WordPress plugin called “All-in-One SEO Pack” on this blog. Everything it does can be manually programmed into a WordPress blog, or any other website, but I consider it a handy tool.

A lot of people will argue about the perfect settings, and what to tell the search engines to not index. For example, in my category archive pages, I added the directive for search engines to not index the pages, but to follow the links found within them to other pages. It is in the header of the page and it looks like this:

Example of NoIndex, Follow Directive (click to see it applied):

meta name=”robots” content=”noindex,follow”

Against some people’s notion of what works best, I have not included the content=”noindex,follow” directive in my blog tag pages (see example source code). This means that by default, my blog tag pages are being indexed. That is a lot of pages, and when you add up the differences in switching from ten blog posts per page to five blog posts per page, it multiplied the number of indexed pages in search engines. Best of all, it happened without any devious trickery or being spammy to search engines, and it simultaneously improved the user experience.

What About Duplicate Content Penalties?

I know that it is popular for people to wake up sweating profusely after having a nightmare about being penalized by search engines for having duplicate content. Search engines frown on duplicated content, because it has often been used in attempts to cheat rankings. It is the topic of many SEO discussions, and a fright to many bloggers and webmasters.

What is duplicate content? An easy way to describe this is by looking at two given blog tag pages. For example, if you seem my “” tag, it may be significantly similar to the content of my “” tag. I also use the rel=”tag” attribute, but that is another article, and still relatively speculative in search engine recognition, and adherence.

If this gives you sweaty nightmares, stop freaking out, walk to the kitchen, and fix yourself a glass of warm milk (or better yet, Scotch). Then take a calming suggestion from good old Murnahan, and try to get back to sleep. Google and other search engines already have figured this out, and they know how blogs work. Yes, Google and other search engines have this under control, and they have indexed more than just a few other blogs.

It is extremely unlikely that you will be penalized for duplicate content, unless you are doing something to intentionally cheat the system. This is a topic for another blog post, but let me just stroke your hair and carry you back to bed. You will be just fine, and the monster under the bed will leave you alone until another time.

A Summary About Posts Per Page

Every blog is different, and some of us have really long and drawn out content, while others are much shorter articles. I also addressed this in a previous article about whether to use blog excerpts or full-length articles on your pages. The article is titled “Blogging Dilemma: Truncated Blog Excerpts or Full Blog Articles?” It is worth a read if you are on the fence about how to display your blog posts.

Because this can make such significant changes to the number of pages on your website, in your XML sitemap, and number of pages indexed in search engines, I suggest carefully limiting the number of times you change this.

I welcome your input, and if you found this useful or thought provoking, maybe your friends will, too. Please add your comments or questions and pass this along to other fellow bloggers.