WordPress-to-WordPress Import
I know there are quite a lot of folks who have wanted to merge WordPress blogs or in one way or another import from one blog into another. The feature is coming in the next major build of WordPress and is already in place on WordPress.com blog. Trust me. But for now, I have wrapped that code into a plugin. I’ve already merged two blogs and there are other reasons I need this as well. It works. I have not had a lot of other extensive testing, but for me it works.
So while Matt Mullenweg wrote most of this code, I’ve ripped it off and made it into a plugin for those of us not running bleeding-edge next-gen WordPress blogs.
The exporter pumps a WordPress blog (including comments) out to a WXR file (WordPress eXtended RSS). It will allow you to import blog entries and comments into an existing WordPress blog. It does not overwrite existing entries and it respects authors by giving you the ability to choose who the imported entries are attributed to.
To use it, download the zip (7.6k) or tarball (6.8k) and extract.
- Upload
1wp-xmlmigrate.php
to
1wp-content/plugins/ - Upload
1wordpress.php
to
1wp-admin/import/ - Activate the plugin.
Note: Both of these files are optional. Uploading wp-xmlmigrate.php and activating will only provide the ability to Export a WordPress blog via the Manage > WP Export menu. Uploading wordpress.php will allow you to import an existing WXR file (a dump from another blog). This file is actually an importer, not a plugin, and so activation is not required to use it. Access the Import mechanism through the standard WordPress Import menu.
Really, the credit goes to Matt Mullenweg for 90% of the code.
Changelog
1.0
- Initial Release
1.0.1
- Minor PHP fixes
1.0.2
- Fixes Version check error when migrating from a WP 1.5.x blog
2.0 – Nov 15, 2006
- Rewrite of codebase
- Fixes “dirty” XML export
- Add support for Category Exports
- Adds support in Export for “Excerpts”. Does not fix weakness in wordpress Importer that does not import excerpts.
2.0.1 – Dec 5, 2006
- No Fixes to export
- Now bundled with new Automattic-developed wordpress.php import file
Pick up your copy of the WordPress Bible, a wildly popular resource for beginners and experts alike.
Popularity: 52% [?]



Thank you very much for this plugin. Works quite nicely with WP 2.5 (importing from 2.0.2).
Thanks for this useful plugin.
thx for this tips here i test it on my test wp site
If you get “The uploaded file could not be moved to…” error, the solution is to set the permissions on the ‘wp-content’ folder to ‘777′ using an FTP client.
Does this plugin allow to import only a few posts or do you have to import/ export all your posts?
To use for 2.0+ versions you need to disable these 2 lines at the start of the code:
// if ( ( ‘2.0′ == substr( get_bloginfo(‘version’), 0, 3 ) ) || ( ‘1.5′ == substr( get_bloginfo(‘version’), 0, 3 ) ) )
// {
And this line at the second last line of the code:
// }
just before the PHP end tag
Correction to that last post – I tried it and it doesn’t work. Apparently it’s not supported for 2.3.3 versions etc. I was trying to use this plugin to migrate from 2.3.3 to 2.2.3
Using your plugin, can I select the articles which I want to export import ?
Is this plugin compatible with wordpress 2.5? I uploaded the plugin, activated, copied the wordpress.php file to wp-admin/import – but I can’t see how to export. I’m trying how to figure out how to export all posts from a single category. Thanks.
Of course not, Joanne. The post says it’s for WordPress 2.0 and lower and that WordPress 2.1 and higher (this includes WordPress 2.5) has it built in.
I didn’t know that 1.5.2 blogs still existed any more. But, lo and behold, a client came to me with one!
I used the method in #333 (actually tried it before I read that) but also I had to reformulate the xml stream. I just changed it to ‘text’ instead of ‘text/xml’ because (and maybe it’s just safari — others could be more forgiving) my browser didn’t appreciate the format!
But then it worked.
Thanks! Cheers!
Thank you! Your export plugin saved me from a world of hurt.
I had an old Japanese blog using Wordpress ME 1.5.1.3. I was lazy and never updated it. Finally a problem bubbled up because of some new database version at my host. I had to do a couple of tweaks suggested by commenters above to get it working.
First I added the 1=1 trick to the if statement. This allowed the export option to appear because it wasn’t there at first.
Second I had to delete category_count as Anne suggests above.
After that, the export went fine, and I was able to import everything perfectly into the latest Wordpress 2.6 (Japanese version). PHEW! THANKS AGAIN!