Plugin: Import New Blogger To WordPress

Update #3 (26 April 2007): This plugin has been broken by changes made to feeds on Blogger, and is pretty much unusable anymore. The download links are still there so if you want to try it anyway you can do so. Try to see the method described in TechCounter (the last one) for a good method. Theoretically this would work but I have not tried it. Good luck!.

Update #2: Only 500 posts can be imported via RSS (Blogger limited the RSS feed to only contain 500 max posts). Check out comment 181 and 191 below for suggestions.

Update: This plugin is now known as Blogger RSS Import instead of New Blogger Import.

Back in December, I created a stand alone script to import Blogger Beta to WordPress. I didn’t really expect that many will benefit from it until I received so many comments and bug reports. So here is the improved version, as a plugin. Many improvements were done especially at the database side where WordPress functions are utilized, and there’s no security issue anymore.

Installation

As with any other plugin, here are the steps needed to install this plugin:

  1. Upload the script to /wp-content/plugins folder.
  2. Activate it under Plugins
  3. Look for it under the Manage menu. You should see Blogger RSS Import

Options

  1. Blogger ID: the front part of your Blogger blog. For example, if it’s http://myblog.blogspot.com then you need to enter myblog in the text box.
  2. Default author: if your blog only have one author (i.e. you) and you have created a user before using this script, you can select the user here. All of your posts will be associated to this user.
  3. Match authors…: this is useful if you have not explicitly created your username, or for multi user blogs. With this checked, the plugin will associate the authors with their own post. Any author not found in the system will be created as a subscriber (you need to edit the user later). This option overrides option 2.
  4. Default category: this option generally is the same as option 2 where a single category will be linked to your post. I leave this here for historical purpose and you might never know user’s preferences.
  5. Match categories…: import labels from your Blogger posts. If you don’t have any labels for your posts, it is safe to leave this unchecked and all posts will be associated with the value selected in option 4.
  6. Number of posts per cycle: This is the number of posts that will be imported per cycle, if you choose to have staged import. I recommend this for most users.
  7. I want to import everything all at once: this is the default behavior of the script when it was first released, until some users are having trouble with big number of posts to be imported from their Blogger. This disables the staged import and overrides option 6.
  8. Haloscan friendly: this option will cause your posts to have comment fields (invisible) for this Haloscan importer to work.
  9. Do not import comments: speeds up your import if you have no comment or 100% of your comments come from Haloscan, for example.
  10. Maintain my permalink: Blogger has a different way of setting post permalinks, and luckily it’s included in the feeds. Even if this is imported, you will need to edit your permalik structure to /%year%/%monthnum%/%postname%.html to work. Stephen might want to share his tips on this as he uses it.

Requirements

  1. Either allow_url_fopen is set to On, or the CURL extension is installed on the server.
  2. Full feeds are enabled on your Blogger (see image below)
  3. An open mind 😉

Blogger Feed Settings

Will not work if…

  1. Your site is not hosted on Blogger server (i.e. on your own domain). You’ll need to republish everything on Blogger.
  2. You use other feed than Blogger feed (i.e. FeedBurner)

Tested on…

  1. WordPress 2.0.5
  2. WordPress 2.0.7
  3. WordPress 2.1

Credits goes to…

  1. My wife for being here for me
  2. Charles Wesley for suggesting CURL
  3. Dawn for the staged import
  4. John Halton for asking for the Haloscan import
  5. Stephen Newton for asking for Permalinks
  6. Ricardo for providing a testblog, and testing lots of things
  7. Andrea Trasatti for trying to help with the author & category matching
  8. Sander van Dragt for WordPress MU compatibility
  9. John Bindel for reporting and noticing the spot for the comments dates bug

And many thanks for the donators. Although I can’t withdraw money from Paypal, at least I can pay certain services. I appreciate your support.

Download

I know you are getting bored reading to all of text up there, so here it is:

new-blogger-import-1.0-final.zip (md5sum: 30538edd35c9427363e37dc842e78e07)
new-blogger-import-1.0-bugfix-1.zip (md5sum: 62ec6348b314df8ddd0d8df057e01812)
blogger-rss-import-1.1.zip (md5sum: 5e5b938a288eeb6cc1eb0e4f83edbd7a)
blogger-rss-import-1.2.zip (md5sum: ce31c1b8abf779c6758f026c2fd3bbfe)
blogger-rss-import-1.2.1.zip (md5sum: a4f6912601f25bee3c5ba31d9cd89769)

This is for users having trouble with the zip file: blogger-rss-import.txt (save as .php and upload it)

For those who would like to see the code: blogger-rss-import.phps

Please report all bugs to ady at romantika dot name.

Problems Encountered By Users

  1. Error 502

Warning: fopen(http://xxxxxxx.blogspot.com/feeds/xxxxxxxxx/comments/default) [ function.fopen]: failed to open stream: HTTP request failed! HTTP/1.0 502 Bad Gateway in /home/xxxxxxxxxxx/public_html/wp-content/plugins/new-blogger-import.php on line 143

This problem is usually caused by connection between the host (server) and Blogger being not stable. There’s nothing I can do about it, but you can try again. Many users succeed when trying again.

Extra

During testing, for your convenience do consider WordPress Suicide. You can use it now, compared to before as reported by David in this post. Don’t delete all tables, use these settings:

WordPress Suicide

Update: Justin has announced an upgraded version to cater to WordPress 2.1. This is needed as a new table was introduced to WordPress 2.1

Images

Images are not imported to your WordPress blog, so if your images are hosted on Blogger, they will not be displayed to visitors because of the hotlink protection. Consider this plugin by Notion: Blogger Image Import.

Problems?

If you encounter any problems, you are welcome to email me or post a comment. Please take note however that I will need time to respond, and look at the problems. This code is in no way 100% free from bugs.

I recommend all questions include everything you know, up to the extent of the PHP version on the server, if you know. In any case please included these information as a minimum:

  • Blogger URL
  • Destination WP URL

It would be extra helpful to have a screenshot of the error message, or any particular area you are having problems with. Here’s a good software to capture screenshots called MwSnap.

In short, I need as much information as possible in order to give advice and help you troubleshoot the problem. I am no clairvoyant 🙂

Post changelog

  • February 1, 2007 19:25 GMT+8
    • Changed /%year%/%month%/%name%.html to /%year%/%monthnum%/%postname%.html (Thanks Stephen)
  • February 23, 2007
    • Added problems section
    • Urgent Bugfix – permalinks with dash or underscore not captured. Any other characters used in blogger Id?
  • February 26, 2007
    • Upgraded to version 1.1 and changed name to Blogger RSS Import. I think the new name is more suitable, without the word “new” that confuses many people.
    • A very important update to this version is the ability to extract more than 25 comments, where this problem was faced by John Doe (refer to comments). A revamp was done to the code to extract comments.
    • Also added was the ability not to import comments, and skip cycles to minimize overlapping posts when re-importing.
  • March 4, 2007
    • Version 1.2 is released. Important bug fix – comments dates were incorrectly imported (only effects version 1.1). Thanks to John Bindel for reporting and noticing the problem in the code.
  • March 5, 2007
    • Version 1.2.1 is released due to some problems getting initial comments data (number of comments). I am sensing that Blogger is making changes. This plugin may be obsolete soon so if you want to use it, do it now.
  • March 8, 2007
    • I don’t know what I was thinking, with the phps version. Obviously it would not work as the web server will format the output to be pretty. I’ve provided a link to the text version.

Complete code changelog is available inside the plugin file itself.

If you find this plugin useful, feel free to


0 Shares

258 thoughts on “Plugin: Import New Blogger To WordPress”

  1. Wow. This is really great, and I congratulate you on your contribution to the WP community. I have one question, though, and it’s kind of a unique one.
    I’m trying to help a friend import her blogspot blog over to WordPress. It’s a metablog; she excerpts articles and posts from around the Web and redirects people to the entire post.

    Now. Although in the feed, the title is the permalink (as normal), on the blog itself, the title of each post leads to the original article from which the excerpt was taken. The plugin doesn’t bring those links (to the referenced article) in. Am I screwed, or is there some way that you can suggest I could work around this? Frankly, I’m not even clear on how she did it in the first place.

  2. Guys, maybe I’m just doing something stupid, but I can’t unzip the plugin! what on earth am i doing wrong…? im on a mac running osX and using stuffit expander and getting an error (it says something about 37).

  3. Pingback: Daily Traversal
  4. I’m having the same problem as the person above. Please advise on what to do since I just went through all the steps of downloading WordPress and installing, I’d really like to be able to import my blogger posts asap. Thank you.

  5. @Chris: I completely understand what she needs, but I am really not sure if that is possible with WordPress. If I stumble upon any news I’ll update here.

    @Joi: Katie (below) has found the workaround – renaming the zip file to a shorter name before unzipping it. Weird, huh? 32-bit OS should support long filenames 😉

    @James: Someone else emailed me the same problem except that the problem is some posts prior to a date (older posts). In your case it’s the newer ones. I found some amazingly disturbing inconsistencies between the feeds blogger produce and the posts in blogs having this problem. I suggested to republish the blog, and turning full feeds off and then on again. That’s not a guarantee but worth a try. Let me know if it worked.

    @Katie: Thanks for the information you sent via email. Appreciate it.

  6. Dear comment subscribers, a new version has been posted and the plugin is now known as Blogger RSS Import. This fix is important for future releases of WordPress, and for importing more than 25 comments (as experienced by John Doe).

    Enjoy!

  7. It would be really nice if this plugin both read the labels off my posts (as it claims to do), but also read the rel=tag data out of the body of my old posts, so that all categories get imported.

    Also, will I have to change the autodiscovery links on my Blogger blog temporarily back to the standard ones (I’m using FeedBurner, but the other feed URLs are still very much there, just not linked to) for it to work?

    Thanks so much for making this.

  8. This is awesome. I didn’t do anything really fancy with Blogger Beta so it was a very smooth transaction. 126 posts with comments. It imported the one category that I had not already created when I first moved to wordpress (I moved and waited for a way to move the old posts.)

    What a nice surprise a the end that I could add the data for those commenters that I knew (email and websites as approptiate.

    Thank you!

  9. Hi. First of all, thank you for writing this great plugin. It has already made my life much easier. Second, I’m trying to figure out how to do the following. My blog has a lot of internal links (references from one post to another). When I import to wordpress, all of those links in the text still point to the old blogger blog. Is there any simple way to get all the links in the text of my post to point to the archives of my new blog, not my old one? Thanks.

  10. In the version released on February 26th, the following change must be made in the code.

    On line 355, the ‘$x’ should be changed to ‘$y’, making the line of code:
    $datetime = strtotime($commentsArray[$y][‘pubDate’]);

    This will make the comment dates import correctly.

    -John

  11. As I’ve indicated before, your utility works like a charm, but Earthlink is a pain in the ass and I could not get my permalinks to work, nor have I been able to get meaningful assistance from Earthlink or WordPress.

    I have another question. While there are tons of themes available for layout and design of blogs, it would be nice if the theme used for one’s original Blogger blog could be imported and then modified just as it is possible to import the blog content.

  12. @Ben: If you used version 1.1 check your comments as they all might have the wrong dates. This is fixed in version 1.2

    @Stephen: I’ll try to look on your posts and make changes if possible. As for the feeds question, it should be fine if the original feeds are still available.

    @David: well done. Please Check your comments as they might have the wrong dates!

    @James: Try lowering the number of posts per cycle. It even timed out with 5 posts?

    @Alex: That sounds interesting. However I think that can be made into a separate plugin. Let me do some research and if I have the time I’ll create it.

    @RD: That would be nice. I saw some WP sites uses themes that looks like Blogger themes. Try searching for it.A plugin to import the themes is possible, I think. But that’s really not an easy thing to do.

    @John Bindel: Thanks for this. I didn’t notice the date was wrong!! I’ve updated to version 1.2

    All: For those who downloaded and used version 1.1 I suggest you download 1.2 and re-import. The comment dates were all messed up. I apologize for this inconvenience.

  13. Try as hard as I might, it is not importing the comments. The open mind isn’t even helping. 😉
    Any idea what I’m doing wrong? Please help asap. mucho thanks.

  14. Warning: fopen(http://ungerente.blogspot.com/feeds/112722725067324839/comments/full?alt=rss&max-results=1&start-index=200000) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error in /home/gerente/public_html/wp-content/plugins/blogger-rss-import.php on line 471

    ERROR: [] Unable to comment information from http://ungerente.blogspot.com/feeds/posts/full?alt=rss&max-results=1&start-index=200000

    lines above are result for my process import to wordpress from new blogger, thanks for your help

Comments are closed.