Blog: WordPress
Plasma cutter cutting metal

Importing Large XML Files in WordPress with WXR Splitter

Avatar for John Locke

John Locke is a SEO consultant from Sacramento, CA. He helps manufacturing businesses rank higher through his web agency, Lockedown Design & SEO.

Importing large XML files in WordPress can be a pain. Fortunately, there is a great tool, WXR Splitter, that allows you to split a cumbersome XML file, and import multiple smaller files.

Why might you need to split your XML files in the first place? When migrating a site from staging to live deployment (or vice versa), I normally use a plugin like Duplicator, WordPress Move, WP Clone or BackupBuddy. For 99% of websites, this works smoothly.

Every so often, site migration via these plugins won’t be a smooth process. Usually this occurs when you are moving a larger than normal blog or e-commerce site — several thousands of pages deep — and the destination server has timeout limits set that cannot be overridden easily. Most servers have a time limit that background processes (like installing a clone of a huge site) are allowed to run. In this scenario, What might you do?

If you suspect you’re going to be in this situation at all, you should do a test migration to a dummy site before the big day. This will inform you of any upcoming calamities to avoid. If the normal migration plugins are not going to work, you’ll need to do a few things. First: take an inventory of everything that will have to be moved. Figure out where you are going to store these for quick deployment. These should include your theme files; uploads folder; XML files (we will get to this shortly); and all the Settings for your theme, including menus, theme options, and widgets. Theme files and uploads can be migrated via FTP in these special cases, XML files can be both exported from staging and imported to deployment via the WordPress Importer. But with a gargantuan site, one or more of the XML files will surely be too large to import in its natural form. The WordPress Import plugin will not let you import an XML file larger than 8MB. (Until recently, you could only import 2MB or less with this plugin.)

WXR File Splitter for Windows

This is where WXR Splitter comes in. Version 1.52 of WXR Splitter runs on Windows 7, Vista, or XP with .NET 2.0 installed. Simply choose the file you want to split into chunks and how large you would like your chunk files to be. Moments later, your XML files are ready for importing.

WXR Splitter for Mac

Don’t have access to a Windows machine? There is also a Mac OS X version of WXR Splitter, written by another programmer, and open-sourced on GitHub.


If your normal site migration workflow is thwarted, what is your backup plan? I’d love to hear about it in the comments below.

Avatar for John Locke

John Locke is a SEO consultant from Sacramento, CA. He helps manufacturing businesses rank higher through his web agency, Lockedown Design & SEO.

6 comments on “Importing Large XML Files in WordPress with WXR Splitter

    1. Hi Daman:

      Great to see you here! This plugin has saved my bacon on larger e-commerce projects before, as well. It’s one thing if we control both ends of the migration process, but there are plenty of times where the current hosting prevents a clean migration (due to timeouts and limited server resources.)

      Another plugin that has helped me over the last year with WordPress database migrations is WP Migrate DB Pro. It’s a premium plugin, but worth every nickel, because it saves so much time and hassle.

      Thanks for sharing the Search Replace plugin link. Finding tools like that are always valuable knowledge.

  1. So when you’re ready to import a split file, does it matter which one you import first (i.e. could chronological content be jumbled)?

  2. Hi Sara:

    You can import XML files in any order, and your chronological patterns will remain intact. Each Post/Page has the publish date in the meta information. This means that the site you are importing posts to will have that data.

    Let me know if that answers your question!

    Thanks,
    John

Join the Conversation

Your email address will be kept private. Required fields marked *.