Codeable info

How To Import Facebook Comments To Your WordPress Database

Posted on by in Blog

One of the setbacks of using Facebook for comments is that comments are not hosted in your own database. This can be a problem if you ever want to change your commenting system. For a few months I used a combination of Facebook Comments and the default WordPress commenting system though last month I migrated to the Livefyre comment service.

Livefyre syncs all comments from and to your WordPress database though it can’t import Facebook comments. I thought that the previous comments that had been left via Facebook had been lost forever however Brandon Kraft left a comment the other day that showed that the comments could still be seen in the Facebook Open Graph. This gave me hope that the comments could be imported to Livefyre.

Therefore I contacted Jeremy from the Livefyre team (they offer great support). He advised that the functionality to import comments directly from Facebook to Livefyre does not exist however he recommended the WordPress plugin Facebook Comments to WordPress. The plugin copies comments left via the Facebook Comments Social Plugin into your WordPress database.

Once installed, the plugin will work in the background to import your comments to your database. You can change the refresh interval for importing comments and set the locale for comment imports too.

Facebook Comments To WordPress

There are two import modes: Append New and Remove Missing. In the append mode, only new comments are imported. In remove mode comments that have been removed from Facebook are removed from your database too. I noticed that after selecting the ‘Append New’ option, the page refreshes and shows that ‘Remove Missing’ has been selected. I’m not sure if this means that the append option is not working or if the settings page just has a small bug.

The bottom of the settings area informs you of the number of comments that have been imported so far. The import process can take some time. Depending on how many comments you have, it could take 30 minutes or a few hours. It works in the background though so you don’t have to check anything after activating the plugin.

Import Comments Count

I wasn’t sure whether the import process had worked at first. I initially assumed that imported comments would be shown at the top of the comments page. Clearly this wouldn’t be the case as comments are sorted in date order (newest first) by default. I checked the post editor for posts which I knew had comments left via Facebook previously and saw that the comments had been imported. All I need to do is wait for the comments to be synced to Livefyre.

Imported Facebook Comments

I was very impressed with Facebook Comments to WordPress. It imported all of the previous comments left on WP Mods via Facebook and was straight forward to use. You don’t even have to enter any Facebook details such as your app id or app secret. All you need to do is activate the plugin and wait for it to import all of your Facebook comments.

Those of you who used to use Facebook comments should use this to import all of your old Facebook comments to your database. It’s worth installing if you are still using Facebook comments too as it ensures that a copy of your comments is always backed up on your own site. This gives you the freedom to migrate back to the default WordPress commenting system or a third party service such as Livefyre or Disqus at any time in the future.

Good luck,

Link: Facebook Comments to WordPress

Codeable info

Comments (26)

Comment by Steve says:

Hi, I was looking to transfer the Facebook comments to wordpress and then was looking to move the comments to disqus comment system, however this post helped me to move my comments from facebook to wordpress the next part is to import those comments to disqus system, I am working on the project once I am done with it, will update any issue caused during the process.

Comment by Shruti says:

Right now I am using facebook comments on my site mostly to avoid spammers. But, I am thinking to move to disquss or comment luv for better SEO value. It was a nice reading for me as I was searching for what to do so that I don’t lose current comments :)

Shruti Patel

Comment by mkey says:

Hey, Thanks. It works perfectly!

Comment by JimmyPow says:
Comment by Gretchen Schiller says:

@Kevin Muldoon – Great article, very helpful, thanks! I have a FBook Fan page as well as personal FBook page. I’ve linked the Fan page for comments to import into WordPress, however I’m wondering if its possible to link my personal page as well. As it stands I post a piece on my fan page and then ‘share’ it to my personal page for more visibility. (Personal page is 700+friends: Fan page only 100 likes) I get comments on both Fan and personal pages… Is there any way to set up so both pages can import? Thanks! Gretchen :)

Comment by Eve-Marie says:

Hello there,

Thanks for the article! I tried to add a comment last week to tell you how excited I was about it but it doesn’t show.. ?? weird..
well since then I tried it out and turns out the plugin hasn’t been updated since some times in 2011 and it doesn’t work with my version of wordpress… (one before last, haven’t updated yet).. Has anyone encountered that, has any suggestions?


Comment by antodoms says:

[email protected] Frank I am Facing Problems in Installing this Plugin to my website…. Its even showing Php error in Foreach() Function….  Can anybody help me out… I need to urgently import all my facebook comments to WordPress ….

Comment by antodoms says:

.adslot-overlay {position: absolute; font-family: arial, sans-serif; background-color: rgba(0,0,0,0.65); border: 2px solid rgba(0,0,0,0.65); color: white !important; margin: 0; z-index: 2147483647; text-decoration: none; box-sizing: border-box; text-align: left;}.adslot-overlay-iframed {top: 0; left: 0; right: 0; bottom: 0;}.slotname {position: absolute; top: 0; left: 0; right: 0; font-size: 13px; font-weight: bold; padding: 3px 0 3px 6px; vertical-align: middle; background-color: rgba(0,0,0,0.45); text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}.slotname span {text-align: left; text-decoration: none; text-transform: capitalize;}.revenue {position: absolute; bottom: 0; left: 0; right: 0; font-size: 11px; padding: 3px 0 3px 6px; vertial-align: middle; text-align: left; background-color: rgba(0,0,0,0.45); font-weight: bold; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}.revenue .name {color: #ccc;}.revenue .horizontal .metric {display: inline-block; padding-right: 1.5em;}.revenue .horizontal .name {padding-right: 0.5em;}.revenue .vertical .metric {display: block; line-height: 1.5em; margin-bottom: 0.5em;}.revenue .vertical .name, .revenue .vertical .value {display: block;}.revenue .square .metric, .revenue .button .metric {display: table-row;}.revenue .square .metric {line-height: 1.5em;}.revenue .square .name, .revenue .square .value, .revenue .button .value {display: table-cell;}.revenue .square .name {padding-right: 1.5em;}.revenue .button .name {display: block; margin-right: 0.5em; width: 1em; overflow: hidden; text-overflow: clip;}.revenue .button .name:first-letter {margin-right: 1.5em;}a.adslot-overlay:hover {border: 2px solid rgba(58,106,173,0.9);}a.adslot-overlay:hover .slotname {border-bottom: 1px solid rgba(81,132,210,0.9); background-color: rgba(58,106,173,0.9);}a.adslot-overlay:hover .revenue {border-top: 1px solid rgba(81,132,210,0.9); background-color: rgba(58,106,173,0.9);}div.adslot-overlay:hover {cursor: not-allowed; border: 2px solid rgba(64,64,64,0.9);}div.adslot-overlay:hover .slotname {border-bottom: 1px solid rgba(128,128,128,0.9); background-color: rgba(64,64,64,0.9);}div.adslot-overlay:hover .revenue {border-top: 1px solid rgba(128,128,128,0.9); background-color: rgba(64,64,64,0.9);}

Comment by Kevin Muldoon says:

[email protected] Your comments are still there so they can definitely be imported.
There’s a chance that it is clashing with another plugin. I didn’t have that problem but I noticed the plugin was causing problems when I later installed another plugin that used Facebook, so there’s a good chance that’s what is causing it.
You could try this: deactivate all plugins and then activate the facebook import plugin and try and import all of your comments. Then reactivate all of your plugins. You could put your site in maintenance mode temporarily whilst you did this (using a plugin).

Comment by reelseo says:

[email protected] Muldoon weird.  OK, yeah, there are quite a few.  Here’s one –   I think the plugin is broken unfortunately.

Comment by Kevin Muldoon says:

[email protected] if you have removed all facebook integration (like I did), the plugin should still pull comments that were left on your website.
Do you know of a post of yours that had facebook comments on it. If so, can you visit If comments are shown there, you will be able to import comments.

Comment by reelseo says:

[email protected] Muldoon sorry to ask this again, but I have it up with no errors but it doesnt seem to import anything.  Do I actually need another wordpress plugin for facebook comments or will this pull the comments from a facebook comments implementation that’s hard coded into each post with the SDK?  IE – <div data-href=”” data-num-posts=”2″ data-width=”470″></div>

Comment by Kevin Muldoon says:

[email protected] need to pay me. I’m happy to help out WordPress users for free via the forums. 
I didn’t have any problems with the plugin when I used it. I did have to remove it after installing the sharepress plugin though as it was clashing with that.

Comment by reelseo says:

[email protected] Muldoon You are so kind (Im just now getting back to my emails and seeing this>…  I actually would love to pay someone to help me with a few wordpress things if that’s something you’d be able to do.  Regarding the plugin though, I keep trying the Facebook comments to wordpress plugin but getting errors.  Did you have any issues with it when you installed and activated?

Comment by Kevin Muldoon says:

[email protected]’m working on an article tonight but if you post your problem with the comments.php file in the forums I’ll do my best to help you with it tomorrow.

Comment by reelseo says:

[email protected] Muldoon exactly.  I initially went over to facebook from disqus because it was taking forever to load.  I need to find someone to rebuild my comments php file for my theme (actually need more help than that ;-) because my comments when those services are down, are pretty messed up ;-)  It is however, much nicer to have them sync’d.  Thank you much.

Comment by Kevin Muldoon says:

[email protected] after I installed the facebook comments plugin the facebook commenting service went down. This highlighted one of the problems of using an external service.Obviously, this can happen here too as I’m using Livefyre at the moment…though all I have to do is deactivate the plugin and the default comment system returns and I can then reactivate it later with all comments synced.

Comment by reelseo says:

[email protected] Muldoon Thanks.  Very cool.  Im going to try it out.  I’ve found that the Facebook plugin lags a lot, and isnt really that helpful for social play as I’d thought. So, Im doing exactly what you did but couldnt figure that part out.  Thanks again. 

Comment by Kevin Muldoon says:

[email protected] The comments that were previously left on posts on WP Mods were imported into the comment database using this plugin. :)

Comment by reelseo says:

So glad I found this Kevin.  I thought the facebook comments importer only imported comments that resided on your facebook page.  Are you saying that you were able to import comments created initially on your site, using the Facebook comments SDK?

Comment by Kevin Muldoon says:

[email protected] tip Kraft :)

Comment by Kraft says:

FYI for those using Disqus. The Disqus plugin doesn’t automatically resync new comments in the WordPress db to Disqus. If you’re using a plugin to bring Facebook comments into your WP db, you’ll need to go to the Disqus screen in admin, Advanced Topics, and click export comments. It’ll auto-filter duplicates, so no worries there.

Comment by Kevin Muldoon says:

[email protected] Frank Before I was using a combination of Facebook comments and the default WordPress commenting system. I liked Facebook comments though I was aware that many people don’t use the service. Though the biggest factor in my decision was the spam I was receiving via WordPress comments. It was becoming a real pain to moderate the spam messages I was receiving every day. 

Comment by Thomas Frank says:

[email protected] Muldoon Cool! I switched away from LiveFyre a while ago but I’ve never quite had my mind made up about the decision, so I’ve been wanting a way to back up the comments.
Btw, what was your reasoning for switching?

Comment by Kevin Muldoon says:

[email protected] Frank I just checked your site and you are using the Facebook comments plugin so this plugin should import all comments correctly for you. 

Comment by Thomas Frank says:

Do you need to be using an actual Facebook Comments plugin, or will this import comments from a hardcoded Facebook Comments box like I have on my site?

Codeable info