Sharing our knowledge

Michael Sync

Bulk Image Downloader for Wordpress Users

January 28th, 2008 by Michael Sync

A tool for downloading images from your Wordpress.com blog to your local machine. It is also an example of how to use XML RPC service in C#.

Executable : WpBulkDownloader-Alpha-Executable.zip
SourceCode : WpBulkDownloader.zip

Contents

  • Introduction
  • Background
  • Software Requirements
  • How to use
  • How it works
  • FAQ

Introduction

This is a tool that helps you to download all of your images that you posted in your blog. This tool is created especially for Wordpress.com users but it will support all other blogging softwares in future. You will definitely need this tool when you want to move your blog from wordpress.com to self-host.

WP Bulk Image Downloader (Alpha) for Wordpress Users

Background

My blog was hosted on Wordpress.com last year. I had too many images uploaded in my free space. When I wanted to move my blog to self-host, I noticed that there is no way to bulk-download all of my images from Wordpress account to my local disk. I didn’t want to copy each and every images manually so I wrote this tool that can scan each and every urls from my blog and create the directory based on the URL. And then, download them into my local harddisk. It’s just 2 hours program that I wrote at that time. So, I’m sure that there won’t be all features that you want in this program. But don’t worry. Just drop a comment in this post. I will add the feature that you want in next release.

Software Requirements

How to use it?

The steps are very simple.

  • Configure your blog in Bulk Image Downlader. Click “Options” and fill your blog URL, user name and password as picture below.

WP Bulk Image Downloader - Options

  • Click “OK” button to save your configuration and close the dialog
  • Click “Get Files” button to get the list of image URLs from your blog. (You may need to wait a few minutes while retrieving the list of images from your blog.)
  • After retrieving the list of Image URL, you can click “Download” button to download the images to your local disk. (You may need to wait a few minutes while processing. )
  • After that, you can check all of your images in “Downloaded Images” directory.

How does it work?

Note: This is for those who like to read the sourcecode and want an explanation about codes. If you are just a normal user, you may skip this section.

Firstly, the program will read the user name, password and blogurl from config file. It will append “xmlrpc.php” which is the standard XML RPC interface for Wordpress at the end of blogurl string. Then, it will invoke getRecentPost() API of wordpress. I used opensource XML-RPC.NET library in this sample. As there is no getPosts() API in xmlrpc.php, we have to use the alternative method (getRecentPost() API) for retrieving the posts from the blog. The max number of posts is set to 1000 in the program. If you have more than 1000 posts in your blog, you probably need to change the default value.

If the authenticating is successful then we will get the list of posts from the blog. So, we have to filter the URL of images from the contents. Initially, I was thinking to filter <img> tag from the content. But there are some cases that we used big image in <A> tag and small images in <img> tag. So, I decided to filter the <img> tag and <a> tag from the contents based on the extensions (*.jpg, *.png, *.gif) by using regular expression. After that, I shows the list of URLS in ListView.

When the user clicks “Download” button, I start downloading the image one by one. (Note: I used C# downloader class which is written by Shailen Sukul in this example. ) Based on the URL, the program will create the directory accordingly. For example, If the image URL is “http://your.wp.com/2009/09/image1″ then the program will create the directories like “09″ folder under “2009″ folder under “/Downloaded Images/” folder. So, you can easily upload all of your images to your new host via FTP.

That’s all about how Bulk Image Downloader works. If you have any question, please let me know.

FAQs

1. Can you make the better UI for this program?

Yes. Of course. I’m thinking to change this Windows Form to WPF version so that you will definitely get the better UI for this program.

2. The form is freeze while downloading the images. Why?

Sorry about this issue. For the time being, all processes are running in single thread so that UI will be freeze while processing. I will separate the UI and logic into different thread in next release.

3. Can I request new feature?

Yes. Of course. This is the main reason why I released it as alpha. Feel free to drop a comment in this post. I will make a list of feature requests and will be added in next version.

14 Responses

  1. moeyae Says:

    Good work buddy!

  2. Michael Sync Says:

    :) Thanks, buddy.

  3. » Daily Bits - January 30, 2008 Alvin Ashcraft’s Daily Geek Bits: Daily links, development, gadgets and raising rugrats. Says:

    [...] Bulk Image Downloader for WordPress Users (Michael Sync) [...]

  4. Michael Says:

    Thanks, this program is awesome.

  5. Download your wordpress images with WP Bulk Image Downloader » Myo Kyaw Htun . com Says:

    [...] WP Bulk Image Downloader is written in C# and source code are available for download. You should check out ! [...]

  6. riquard Says:

    Thanks!!

  7. Cathy Tibbles Says:

    This is sooo incredibly awesome!!! The same thing is needed for typepad and Movable Type so that we can move to self-hosted wordpress!

  8. det Says:

    Michael, i found this tool and it seems to be THE solution to all of my problems… BUT (of course there is a but)

    I can’t download any images from april 2008 and forth… it seems to work fine with every other image from 2007 to that date…

    I don’t have more than 1000 posts, but if you count posts, comments, and tags, the number is far greater than 1000…

    Could it be the reason? How do I change that? I have NO IDEA on programming, nor how to compile a file or something, so any help would be very much appreciated

    Thank you!!!

  9. BlogInstall Says:

    Hey, just found your tool and will be trying it out in a second after I update to Microsoft .NET Framework 3.5. Will be sure to comment on the process!

  10. mart Says:

    Michael, I’m having the same problem as det here. The software won’t download images older than april 2008. This probably is a simple bug.

  11. bambit Says:

    perfect! made the move from wordpress.com to my own hosted server with nary a hicucp. fantastic plugin. thank you very much.

  12. Shailen Sukul Says:

    Mentioned you on the project site at http://bloodhound.codeplex.com

    Thanks for giving credit.

    Regards
    Shailen

  13. Michael Sync Says:

    Thanks, Shailen. :)

  14. Moving your blog from WordPress.com into self hosting « .:: Peta Konsep Anak Bangsa ::. Says:

    [...] Bulk Image Downloader for WordPress Users, that tell how to move the images from old place to new [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.