Import Blogger Beta to WordPress

This page is outdated. Please click here for the update. Comments are closed on this post.

As I have not heard anything about the solution to this problem, I wrote a script. This script is a simple but powerful 😉 script which extracts the posts and comments from RSS feeds at blogger.com.

Instructions:

Copy the script to your main WordPress directory and run it (http://your.name/blogger-beta-import.php). The options are self-explanatory. This means you can customize the category and user before importing.

Warning:

This script represents a security hazard if left on the server. Once you are finished, delete it. Don’t even rename or save a copy on the server. The script does not honor WordPress authentication and checks, but utilizes some of WordPress’ functions.

Limitations:

  • No handling of images (stay on blogger server)
  • Comments will have the names but not email or URL – limitation with RSS from Blogger
  • Unlikely to work if you use other comment systems
  • You need to enable RSS feed for comments – very important!

As for images, they will stay in blogger.com but I suggest you download them at once to your server as Blogger does not allow hot-linking (images will be blocked). You don’t have to do it one by one, you can use this plugin by Notions: Blogger Image Import. I’ve tried it and it worked well. One thing is that it depends on CURL to download images – servers without this extension will not execute the script. Let me know as I have a workaround for this, provided that your PHP version is later than 4.3.0.

Please don’t look at the code as it is written in 2 hours without so many cosmetic or improvements in efficiency. This script will work on existing WordPress installations but due to some assumptions made, it may break certain things like post counts for categories, etc. I suggest use it only on a virgin WordPress installation. However, I’ve tried it to import several different blogs and the result is awesome – it looks like multi-user blog 🙂

This code will be short-lived, I think as Blogger is finalizing their system out of Beta. One little change on their system would mean disaster for this script, and I am not sure I will have the time to give any kind of support. So, be quick and import now, while the script still works!

I have not tested this script with blogs larger than 300, if you encounter problems do let me know, maybe we can split executions.

Download the script here:

blogger-beta-import.zip (2.81KB)
blogger-beta-import-0.2.zip (3.64KB)
blogger-beta-import-0.3.zip (3.69KB)
blogger-beta-import-0.4.zip (4.86KB)
blogger-beta-import-0.5.zip (4.94KB)

Changelog:

2006-12-22:

  • Added ability to add commentor URL and email since these data can’t be obtained from RSS.
  • Added extra checks to terminate script if something fails. No use wasting user time to wait for a broken result.

2007-01-01:

  • Bugfix: When a comment author’s name contains apostrophes it will fail to be loaded into the database. Update 0.3 fixed that – thanks to Dawn.

2007-01-11:

  • Added automated checking for feed retrieval mechanism (fopen or curl). If both are not available, the script will tell you and not run 😉
  • Added code for retrieval using curl.
  • Added ability to make step by step imports – useful for people having bandwidth or server speed problems. Requested by Dawn.
  • This script has only been tested in few sites, so if you encounter any problems do let me know.

2007-01-14:

  • Bugfix: First import does not work, page have to be refreshed to make it work – thanks to Jonas.

I suggest you download the script only from this site, especially if you’re not a programmer as PHP codes are easily modifiable for malicious intent.

I will not be liable for any problems you might have with your WordPress installation. Use this script at your own risk.

Comments are welcome but I may take some time to respond as my time is limited.

How to make sure full feeds are available:

Switch to Advanced Mode and make sure your settings are like this:

Blogger Feed Settings

Special Notes:

Thanks to Charles Wesley for his suggestions on using the CURL library.

Tested On WordPress versions:

  • 2.0.5 – Working.
  • 2.0.6 – Working.
  • 2.0.7 – Working.
  • 2.1 – Working. Thanks to Ricardo

TODO:

  • Import by a number of posts at a time (staged import) – done
  • Haloscan import support
  • Mapping of categories from blogger
  • Mapping of authors from blogger
  • As a plugin
  • Include an option to import all posts without staging
  • Maintain permalinks from blogger
0 Shares

160 thoughts on “Import Blogger Beta to WordPress”

  1. I’m new to WordPress and confused about how to run this script – I am under the impression I need to have my own site host to use it? Or if my blog is hosted on wordpress itself – can I load this script and run it???
    Thanks

  2. @Gareth: There are two main kinds of WordPress:

    (1) wordpress.com where your blogs will be hosted on wordpress.com server and usually have the URL http://YOURNAME.wordpress.com

    (2) wordpress.org where you download and install your own wordpress blog, on your own server.

    This script will only work on the second kind.

  3. Hi Ady,

    Worked like a charm!

    Utter frustration with Blogger and how it interacts with my ipowerweb.com led me down the WordPress path. Looks great. Changed the publishing from my own server and made it a blogspot. FTP’d the php script into my WordPress directory, executed it and viola 1229 successful entries! Thanks again. Now for the images…Notions here I come!

  4. Thx Ady. Your script worked nice and quick and helped me aggregate my several blogs into one wordpress blog with different categories.

    My only problem is that I made use of the link url field in blogger (the one where the blog title is also a URL link) and of course as wordpress doesn’t have this, a lot of my posts which reference ‘the linked site’ no longer make sense.

    I found this post on the wordpress support forums which mentions using a custom tag to store this URL
    Tag Data from Blogger « WordPress Support this post on the wordpress forums

    Can your script be adjusted to gather this URL and store it in a Post-URL tag?

    Thanks

  5. @Reboots DaMachina: Great! Wow 1229 posts – I am happy to hear that. You must have a very fast connection the blogger server. This proves that the other variables causes problems, not the script 😉

    @Kon: I understand your problem. Let me know your blogger URL and point me to an example post so that I can analyze later. Also note that this is appended to my current TODO list which I owe to earlier users 🙂

    @Bronte: Glad it helped.

  6. Thank YOU!
    I’m another betablogger refuge (victim) who held out for along time, then gave them one last chance by updating to beta. ..only to find out that this was a bad idea. Your script seems to have worked flawlessly, and since I had been hosting on my own domain by ftp, even kept the links to the pictures!
    Thanks so much!
    L.

  7. @amad: It is the same way you upload your WordPress files in the first place – using FTP or any file manager mechanism. This is why I don’t explain how to copy the file. WordPress.com users can’t use this. I am also unsure about WordPress automatic installation offered by some hosting companies. Which hosting do you use?

    @Lorraine: Well done. Just a hint: you can use the options to make your WordPress blog accessible via http://www.toomadforpants.com/ instead of http://www.toomadforpants.com/wordpress/ later if you prefer, even if the files are installed in /wordpress

  8. I can’t get this to work at all. I put it in the main directory and launch the file, which works. Then I put in my username and hit Import. I get the following message:

    The webpage cannot be found

    HTTP 404
    Most likely causes:
    There might be a typing error in the address.
    If you clicked on a link, it may be out of date.

    What you can try:
    Retype the address.

    Go back to the previous page.

    Go to laceykaye.sslpowered.com and look for the information you want.

    More information

    When I take the “s” out of https and delete the sslpowered. then I get a blank success page. What am I doing wrong”

  9. Anyone know how to get the pictures to import into my new WordPress install?

    I successfully brought over 1229 posts, but when I used the picture importer from Notions, it runs very quickly and says 0 imported.

    Any help from others who have been down this road is appreciated

  10. @Lacey: very weird indeed. I am not sure what to suggest. Let me think.

    @Reboots: have you made sure that the folder wp-content/uploads is writable by the web server process? e.g. chmod 777

  11. Probably a stupid question, but before I try this: will running this import script delete/mess-up my blogger page? I’d like to leave it up and don’t want to risk losing it. Anyone who has tried this already, feel free to answer. Thanks for your time and efforts!

  12. @Lucas: unlike the old blogger import that are built in to WP, this importer extract from feeds and does not at all modify blogger settings / pages. So go ahead.

  13. Hi Ady, re-read notions site about the image import and in addition to creating ‘uploads’ directory in wp-content, I created ‘blogger’ directory. 777 on both. But still no images. Resulting message during test is:

    Importing a maximum of 10 images
    Posts Processed : 1230
    Images Imported : 0 (+ thumbnails)
    Success!

Comments are closed.