Depending on the web hosting company you choose and the package you select, each of you will see maximum file upload limit on your Media Uploader page in WordPress. For some it is as low as 2MB which is clearly not enough for media files like (audio / video). Most pictures are under 2MB, so it is fine for just pictures. In this article, we will show you how to increase the maximum file upload size in WordPress.

Note: This is an intermediate level tutorial. It may not work with some shared hosts in which case you would have to ask your hosting service provider for support. We use HostGator, and they are more than helpful when it comes to issues like this.
1: Theme Functions File
There are cases where we have seen that just by adding the following code in the theme function’s file, you can increase the upload size:
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
2. Create or Edit an existing PHP.INI file
In most cases if you are on a shared host, you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
This method is reported to work for many users. Remember if 64 doesn’t work. Try 10MB (sometimes that work).
3. htaccess Method
Some people have tried using the htaccess method where by modifying the .htaccess file in the root directory, you can increase the maximum upload size in WordPress. Open or create the .htaccess file in the root folder and add the following code:
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
Again, it is important that we emphasize that if you are on a shared hosting package, then these techniques may not work. In that case, you would have to contact your web hosting provider to increase the limit for you. Some hosts completely turn down their users. We recommend that you use HostGator. Their support folks are very helpful in these situations.








thnx, but i am in a shared hosting so nothing work, i did put the php.ini in wp-admin and in the blog folder and in the homefolder and dodnt work also .htaccess didnt work changed the theme and didnt work
Adding code in .htaccess file might throw you 500 Internal Error… the best way is create a php.ini file and upload it in wp-admin folder
htaccess method works fine for me. thanks
Hi,
I have done all of the above and still wont let me import an 11mb xml file. i need it as its got 1500 products on i need to import.
I have spoken to my virtual server provider 1and1 and they said all i need to do is add the code to the .htaccess file but it doesnt seem to work
Please someone help
If none of the above works, then the only person who can help you is your host.
None of this worked for me. I tried them all. I am using WPEngine to host.
Any suggestions?
Ask WPEngine to increase the limit for you.
The htaccess method worked for me. Thanks for the post. Good info, well presented.
php.ini option worked for me but on the php.ini file in /wp-admin directory
perfect – worked a treat – set to 200MB and works fine.
In localhost work the .htaccess. But in host only php.ini. Thanks for help.
Thanks htaccess worked for me appreciate it.
I have hosting on mediatemple. First two methods are not worked me. Only htaccess methos is worked for me.
Thanks.
I found that php.ini was hidden in the cgi-bin folder which some shared servers have in their root directories. I amended this as above (AND added a php5.ini jut in case) but until I’d amended this, nothing else worked. Thanks for the VERY useful thread!
Thank you very much for this article!
thank you so much! had tried so many solution and your .htaccess finally worked
The only thing that worked for me was to create/edit a php.ini file and add the following:
memory_limit = 100M upload_max_filesize = 100M post_max_size = 100M file_uploads = On
and uploading it to the wp-admin folder.
Option 2 worked perfectly fine, though I had to place the php.ini file into the wp-admin folder instead of the root directory.
phpinfo was detecting the php.ini file in the root, but not WordPress.
I currently have WP 3.2 installed…
Thanks for that extra tip, this is what finally worked for mine
thanks anthony, your method saved me a lot.
This is exactly what worked for me as well.
Thx
thx for this post , but what is the default limit ?
64 MB
It was 8MB, but I got it to 192 MB @almb1111
Ty for responding, I finally got some help with it, I needed to change the PHP to PHP-5.
I am evidently newer than most here, I don’t understand which is “root” directory, is it Editor under the Appearance tab? Also, I don’t undertand how to get to hcaccess. Any help is appreciated.
htaccess method works for me. – cheers!
What is the highest limit for upload
can i set it to 1024M ?
The .htaccess method works for me. Thanks.
Thanks for the code.. it is really helpful for me..
Yes ! putting php.ini also in wp-admin works for me. thanks
Thanks, but neither of this worked for me.
But I found the solution!
I had to place that php.ini to /public_html AND /public_html/wp-admin and it works!
ya..the same thing works me too..
Thanks Snisley
Great! This worked for me as well
I run WordPress on an MS Server 2008 with IIS 7.5 from my host provider, btw
Worked for me as well. Thanks!
Thanks dude. It’s works for me.
At the end of a post, I want to display recent posts from that specific category under that post – how can I do this?
Thanks for that tip. But obviously I’m on a shared server ;-(
so that didn’t work for me.
If you are using PHP5 the file should be called php5.ini and be in the root of the shared folders.