Blogger Image Import
Blogger Image Import
Blogger Image Import is a WordPress plugin that copies blogger hosted images to your local WordPress server. It scans through your posts looking for images with thumbnails hosted on blogger.com or blogspot.com or any other domain you specify, copies the files to your local server, and updates the post to point to the local files. This is required if you have imported a blogger blog to WordPress that contains images.
I wrote this because I was importing a blog from blogger to my own server running wordpress and couldn’t find any other automated way to do this. This is only tested enough to satisfy my needs and, at the time of this writing, has not yet been published.
WARNING!!! This plugin makes permanent changes to your WordPress database that cannot be undone. This is still in development and has not been thoroughly tested. Do not run this on a production blog without a backup or you may permanently destroy the content. Preferably run this only on a test blog with the expectation that it may need to wiped clean if something goes wrong. Consider yourself warned.
UPDATE: Version 2.1 is a minor update with a fix to the regex and the addition of “jpeg” to the list of valid image extensions. If you were having trouble getting the plugin to find all of your images, this might help.
UPDATE: Version 2.0 has been released with all of the user submitted changes and fixes, as well as a few of my own.
- Added support for multiple domains (blogger.com and blogspot.com by default).
- Added support for multiple file types (jpg, gif, png, tif).
- Applied user fixes to make it work with the latest versions of Blogger and WordPress.
Download latest version here
You can install the plugin directly from the dashboard of your WordPress blog. In the Plugins menu, select “Add New” and search for “Blogger image import”. Select “Install” and then activate it once it is installed. Proceed to step 3 below.
Here are the steps for the older manual installation.
1. Unzip to your plugins folder, usually `wp-content/plugins/`.
2. Activate the plugin on the plugin screen.
3. Access it from the Tools menu under “Blogger Image Import”.
4. Select the maximum number of images you wish to process.
5. Click on “Test Import” to do a test pass or “Start Import” to permanently apply the changes.
How it works
It scans through each WordPress post looking for a specific signature of .jpg/.png/.gif/.tif images hosted on blogger.com or blogspot.com with thumbnails. Specifically, it is designed to match images that were posted to the Blogger blog using Hello or Picasa.
When it finds a post, it copies that file to a local server folder (wp-content/blogger/…) using a similar directory structure to that on the original host. This is to avoid duplicate files so if a file already exists it will not download it again.
The post is then updated with the new image URL and written back into the database.
- The script will not yet handle images with non-standard links or img tags. Any img tags with no <A> link tag around them will not be copied but a warning will be displayed indicating which files were skipped.
- The script can take a lot of time for the server to copy a lot of the images and can cause your server to timeout. It has been designed to recover from these situations but could possibly generate corrupt files or DB entries if terminated improperly. Be careful how many images to have it update at a time.
- The script has the code in it to create image posts, like the way uploading an image to WP 2.0 now does. However, I decided this wasn’t useful and have commented that code out. With that code enabled the script also does not recover well from being terminated at the wrong times and could result in duplicate posts.
- File Permissions and error handling. It has been reported that if the directory permissions are not set correctly that it will fail and could possibly update the posts without copying the files. This is a high priority fix but please be careful to set the correct permissions in your wp-content folders.
This software is licensed under the CC-GNU GPL.