WordPress has a function in the administration area where you can export your blog content and import them unto a new blog installation. That works fine as is if you are importing a small file. However, when your file is larger than 2MB, the problem starts. The default limit for uploading an XML import file via the WordPress admin area is 2MB. Here’s a way to override that limit using htaccess.
First, open Notepad (or a text editor) to create a file and name it “.htaccess”
Upload this .htaccess file into the root directory of your server (where your site resides).
Cut and paste the code below into the .htaccess file:
#set max upload file size
php_value upload_max_filesize xxM#set max post size
php_value post_max_size xxM
Change the “xx” variable to a number that meets your requirements. For example, my latest client needed me to import a 28MB XML file, so I just went ahead and changed the “xx” variable to 48. I was then able to import the WordPress XML file successfully.
Here’s what the final .htaccess file looks like:
#set max upload file size
php_value upload_max_filesize 48M#set max post size
php_value post_max_size 48M
Hope this solution works out for you!
*If you need help with your WordPress blogs, just contact me with your project requirements. I’ll then respond with a quote accordingly.
→ Posted in Category: Tutorials
Here's where you can leave a comment regarding the above post.
12 Responses to “How to Import a Large WordPress XML File and Override the Default Limits”
Leave a Reply



























Hi,
I am having errors after uploading the edited .htaccess file
import.php gives out 500 message error.
Any ideas?
Does your server support htaccess files? Some servers don’t allow htaccess to run. If your server supports htaccess, have you checked the file permission settings after uploading the file? CHMOD file permission of your htaccess file to 644 and try again.
I found your article and attempted to use it to fix my problem with WPMU.
When attempting to upload an rss file smaller than 2MB, I get the “This file is to big. Files must be less than 120kb in size” response from the WPMU interface.
I am looking for the restraint that is causing this issue.
I have so far made modifications to:
php.ini, admin.php, import.php,rss.php
I am at a loss and would be greatly appreciative of any help you might provide in resolving this issue.
Thank you for your assistance.
William Eisner
W.E. Enterprises/www.businessonahost.com
Hi William,
Sorry for the delayed response. I had been out of town and just got back…
Has your problem been resolved?
Try using the .htaccess solution and see if that works.
wow that worked so simply!
thanks
wonder why wordpress wouldn’t let you upload larger files…
Thanks for the suggestions and information’s,
initially i used to do so via php.ini files.
Now i implement the necessary changes in .htaccess files .
There’s every chance you’ll find it timing out at that large a size – might as well edit php.ini.
I’m having issues as well, and I’ve tried to add the file, I’m wondering if you can help me with it?
that is not working for me. Please help!
Amanda,
Does your server support htaccess?
If not, there are other ways to transfer your data.
-Bryan
After5PC.net
Thank you – that worked perfectly.
[...] If the file is too large, then you can try overriding the various file upload limits under PHP, and WordPress: How to Import a Large WordPress XML File and Override the Default Limits [...]