Discussion on how to split large XML files in WordPress is being shown in this article.
When you buy a WordPress hosting plan from a web host, they have a certain limit up to which you can upload a large file at once. For example, most of the web hosts have WordPress hosting plans where you can upload up to 2 MB file at once.
This is more of a hidden restriction that you will not know unless you upload a large file and face the problem. When you are going to transfer your existing website or blog to WordPress, the existing posts need to be exported to a large XML file. But it may so happen that the size of that XML file crosses the upload file limit that your web host has set universally.
In such scenarios, you need to know how to split large XML files in WordPress.
To illustrate the point better and realistically, let us assume that you have an existing blog in Google’s Blogspot or WordPress.com. These platforms are absolutely free, and hence, some find it ideal to start their blog and then eventually move on to WordPRess.org or other paid platforms. The process of migration from one platform to the other requires exporting an XML file which contains all the posts that you have on your blog. If you blog has too many posts, naturally, the size of the exported XML file will be very large. When you will upload it to your new web server to retrieve those posts, the file will not upload as the bandwidth for upload set by your web host is getting crossed. You can ask your web host increase the limit but in most cases, they will not as it is a universal limit. Therefore, the only way out is to split large XML files in WordPress. After splitting them into smaller files, you need to upload them one by one.
teps To Split Large XML Files In WordPress Automatically For Windows User–
There are two ways to split XML files – one is automatically and the second is manually. The second one is time-consuming but more efficient. But in today’s world, nobody has the time to split a large XML file into small files and adding the required properties for consistency. Therefore, most of the users use free tools available in the market to split large XML files in WordPress effortlessly. There are different tools available for the different operating systems.
If you a Windows user, there is a tool named WordPress WXR File Splitter that will come handy. You have to download the application and run it from your desktop. One you have started the application, you will see a screen as shown below.
You will see that there is a button named Open WXR File. Click on that button and select the XML file where you have stored. The XML file has been exported from your existing blog, and it contains all the posts. Once you select and open the file through the application, it will read the complete file and analyze it to show you some vital information regarding the data inside it. It will show you the header and footer information and the number of posts and pages are there inside it.
What you can do with the application is you can set the limit of the file size according to which the smaller files will be created. Make sure the limit you set is lower than the limit your web host has for uploading the file which is generally 2 MB. Alternatively, you will have the option to set the number of smaller files you want the larger file to split into and accordingly the larger flie will get divided equally. When all the parameters are set, press the Split button for the process of splitting to begin. The files will get stored in the same folder where your the larger XML file.
Steps To Split Large XML Files In WordPress Automatically For Mac Users –
The tools vary according to operating systems, and Mac needs a different software. There is a very similar software named WordPress WXR Split Utility available exclusively for Mac users. It does the same thing of splitting larger XML files into small one. Download the tool and install it and then run it. You have to select the file to split and then mention the file size of the smaller files. You will also be able to select the output folder.
But the limitation of using this tool is that there is a certain limit of how large the XML file can be. If it is more than 1 GB, it would be unable to do it. In such scenario, there is another way out.
You would need to download MainSplit Script file. It is a script file written in python to split any XML large into small ones without any limitation. You need to download mainSplit.py and not mainSplit.txt.
Once you have completed downloading the file, you need to open Terminal Console from Application> Utilities folder and type the following line and press Enter.
~ Admin$ python mainSplit.py
Once this line starts running, it will open a new window named WordPress XML Splitter. All you need to do is click on Browser File button and select the Source file which is the large XML file you intend to split. Then you have to select the output directory where the smaller files should reside by clicking on Browse Directory button. Then press on Start button to initialize the process of splitting.
As you would notice that you have no option to select the file size because, by default, it creates smaller files that have file size below 2 MB which is the default limit of most of the web hosts. You can check out the output folder for the same.
Hope you have understood clearly how to split large XML files in WordPress automatically with available tools in Windows as well as in Mac. If you want, you can ask your web host to upload the large file at once for you. In such scenario, you should speak to their support team about it before buying the hosting plan.