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.
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.
It was really helpful for my website. Thank you
Jennie
Friends This works perfectly.
If you have VPS then we can control the maximum php upload size and php cluster size.
The benefit of this Article is so much because most of the wordpress scripts run on shared hosting.
As ashish says this also works well by edit php.ini
Break into small pieces the file is another solution,
free software: mp splitter
http://www.mpwebprogrammer.com/descargas/mp-splitter
only in Spanish.
Hi, I tried the steps above, when I checked on the file manager on my web, they already have the “.htaccess” file.. and when I add the codes, it says internal error. Any advice?
thx
Where are you adding the code? It is probably placed in the wrong location
I have the same problem.
I added the code at different places.
On the beginning and the end of the .htaccess file.
And also one time only your code without any other code.
Allways set CHMOD file permission to 644.
I allways get the 500 message error.
Do you know any other ways to bring the data back into my blog?
Thank you in advance!
puri
puri,
Sorry, I moved to a new location and just got my internet connection setup.
Are you still having problems? If so, please contact me through the contact form on the site. I can troubleshoot the problem for you.
Regards,
Bryan
After5PC.net
Thnx Your Way Helped
HELP! i am desperate to import from wordpress to blogger!!! my xmlis 1.70 and i have no idea what i’m doing!
tawkle!
its safe free and unlimited
where do u upload the .htacces file?
in pubic_html?
it will replace the existing one.
and wp wont work?
Fred,
You can edit the existing .htaccess file to include the suggested coding.
I would not suggest replacing it without backing up that file, because your existing .htaccess file may be used by another software in your server to serve its function.
You have to tell us full code which we put in htaccess file.
when I put :
# BEGIN WordPress# END WordPress
No Error occur
but when I put only :
#set max upload file size
php_value upload_max_filesize xxM
#set max post size
php_value post_max_size xxM
500 internal error occur.
Please tell me what we have to put in htaccess file or put in php.ini file???
tell me datails…
thanks yus, it work in my blog
tried it, didn’t work.
try giving advice that actually works next time, ok?
You’re welcome.
Patrick,
It worked for many. Perhaps it’s a user error? I can help you if you need my services.
hi,
I managed to put the .htaccess file, it works…it shows me 100MB as i set 🙂 BUT ia m getiing this error:
“File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.”
Help!
thanks!
Hi, I tried this and it worked fine to let me import a large XML file but then all my sites give a Internal Server error 500.
Removing those lines restores the sites.
Any ideas how to have the larger limit AND my sites?
Thanks for the help so far…
Mark,
After you have successfully imported your files, you can then remove the above codes from your htaccess file
Bryan
http://www.After5PC.net
Thanks for a lot.. wordpress import problem solved.. thanks again… great solutions..
Thanks the author. I really appreciate it. It’s very helpful everyone who don’t know about this code. I again I back this website.
Thank you. Do you need to restart the server after changing the .htaccess?
From what I recall, there’s no need to restart your server after making the changes. Just refresh your BROWSER and proceed.
Thank you for your help After5PC :-).
Hi,
first of all, thank you for this… it worked.
unfortunately, i have server/host issues. to summarize it, my website experienced the wordpress white screen of death, my friend managed to fix it and then the newer posts disappearing then reappearing again a never ending cycle. So, i have decided in heavy heart to have it wiped out, delete it all.
when im building my new website, i was happy to find your blog about the work around in uploading the backup file that is more then 2mb. and everything was fine. unfortunately, my website once again jumped to another version. the version where the wordpress was just freshly installed deleting all the changes and import uploads i made. So, i did what i did again, upload htaccess copy paste the thingy.. and this time it didnt work 🙁 the file permission is 644. still not working. so i am hoping you can help me on this? ^_^
i am yet to google on where to find the php.ini file. il try some of the workarounds mentioned in the comments for now.
Thank you
Hi Paige,
I’m glad you have found this posting helpful with your wordpress website. Are you still having problems? I’ve checked out the site, and it seems to be running fine on my end now. Hopefully, things have resolved. Cheers!
-Bryan
After5PC.net
Hi Bryan,
Thanks for the reply.
I guess i got tired of trying all the options i found in google on how to increase the limit, so i just looked for other options and found this software on breaking up the file so i can import it.
Thanks for sharing
That code killed my entire site. I removed it and everything returned to normal.
Does your server support htaccess, or did you input the codes correctly? Otherwise, you will receive a server error.
Regards,
Bryan
After5PC.net
the existing htaccess file has
# BEGIN WordPress
# END WordPress
do you put this new code
#set max upload file size
php_value upload_max_filesize 48M
#set max post size
php_value post_max_size 48M
in between the above , before or after?
Is this the only thing in your htaccess file? I am assuming your site is fully WP-based then.
Place this code outside the existing WordPress code. So either before or after should work.
perfectly works