Tips to Split Large XML Files in WordPress
May 27. 2022
Were you trying to migrate your blog from wordpress.com to wordpress.org but for some reason couldn’t? Well, you’ve come to the right place as we know exactly what the problem is and how to easily solve it. So continue reading as in this post, we’ll let you know why and how to split large XML files in WordPress.
Trying to upload a large XML file to WordPress?
There are usually two scenarios when you need to export your WordPress content:
- If you’re trying to migrate your blog from wordpress.com to wordpress.org.
- If you’re moving content from a self-hosted WordPress website to a new host or server.
The good news is that you can export your entire WordPress website as a single XML file. This file will include all of your posts, pages, comments, custom fields, categories, and tags. This is also known as the WXR file which stands for WordPress Extended RSS.
How to create a WXR file?
WordPress includes an export feature that lets you save an XML file containing information from your blog to your computer. WXR is crucial for the XML file. You can use the WXR file to move your present WordPress blog to another website. You can also download pieces of your site, such as posts or pages, or create a WXR file that contains all of the information from your site.
Creating a WXR file is quite easy:
- First thing first – log in to your WordPress dashboard.
- Hover the mouse pointer over “Tools” and once the options show up, select “Export”. You’ll now access the “Export” page.
- You’ll be able to choose between “All Content,” “Posts,” or “Pages,” depending on what you want to export. For example, if you want to create a file of your WordPress pages, click on the “Pages” button, or if you want to make a file of your full website, click on “All Content”.
- From the drop-down menus that appear when you select “Posts” or “Pages,” select any appropriate filtering parameters. If you don’t update the filters, all of the posts or pages will be downloaded.
- Click “Download Export File” and after selecting the location where you want to save the WXR file, click “Save.”
Why should you split large XML files in WordPress?
The bad news is that the WXR file can sometimes be too large to upload and, if that is the case, you’ll receive an error message. You’ll be unable to upload your XML at once unless you find a way to make it smaller.
There is a simple reason why this might be happening to you. Namely, when you purchase a WordPress hosting package from a web host, there is a maximum file size that you can upload at once. In most cases, most web servers offer WordPress hosting plans that allow you to upload up to 2MB of data at a time.
Don’t worry if this is the first time you’ve heard about this. In fact, this is more of a hidden constraint and most people notice it only when trying to upload a large XML file. You can request that your web server extend this restriction. However, they are likely to decline due to 2MB being a universal limit.
That’s why it’s useful to learn how to split huge XML files in WordPress. Of course, you can always have this done as a part of maintenance tailored specifically to your website but in case you want to do it on your own, continue reading. Further in this article, you’ll find out how to easily make a large XML file smaller and possible to upload to WordPress.
A simple way to split large XML files in WordPress
Now that you’ve exported what you needed from your website and have a ready XML file it’s time to split it. The easiest way to do this is to use the free WXR File Splitter Tool. Simply click on the link and once you access the page, you’ll find a pretty straight-forward tool that can help you break down your huge XML file.
Once you’re on the website, simply drag your XML file onto the section labeled “Click or drag a file to this area to upload“. Alternatively, you can select the XML file by clicking the ‘WXR File’ option.
After that, adjust the “New file size” slider to the maximum upload size for your website or smaller. Your goal is to make several little files that can be uploaded to your host without exceeding the file size constraints. Once you’re done, simply click on “Submit” and your XML file will be split into easily manageable pieces you can quickly upload to your new website without any restrictions.
Finally, you must click the “Download” button to save the files to your computer’s default download folder. The files will be compressed into a single file that must be unzipped before being imported into your new website.
Are you a MAC user?
In case you are MAC user, you’ll need a different software. WordPress WXR Split Utility is a very similar program and it’s available exclusively for MAC users. It works the same way as WXR File Splitter Tool and the main difference is that you will need to download and install this software.
First, you’ll need to select the file you want to split and then provide the smaller file sizes. You’ll also have the option of selecting an output folder.
However, one disadvantage of using this tool is that the size of the XML file is limited. It would be impossible to do so if the file size exceeded 1 GB but there’s an alternative if that’s the case. Simply download the MainSplit Script file which is basically a python script that can split any XML file into little chunks without any restrictions. Make sure to download mainSplit.py instead of mainSplit.txt.
After you’ve finished downloading the file, go to the Application> Utilities folder and open Terminal Console. Type the following line and click Enter. When you run this line, a new window called WordPress XML Splitter will popup. Simply choose the huge XML file you want to split by clicking the Browser File button.
Then, using the Browse Directory button, select the output directory where the smaller files should be saved. Then press the Start button to begin the splitting process. You’ll notice that there is no option to choose the file size because it automatically creates smaller files with file sizes under 2 MB, which is the default restriction for most web servers.
The bottom line
We hope our article helped you understand how to easily split large XML files in WordPress. But why handle the daunting task of migrating your website on your own? Simply reach out to WP Full Care team and let professionals make sure your website is running as smoothly as possible.