Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Increase the Maximum File Upload Size in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Increase the Maximum File Upload Size in WordPress

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.

Media File Size Limit

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.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. hol says:


    Does anyone know why if the PHP.INI file is changed as mentioned why when the file has completed to 100% nothing happens and it displays http error.

    I can upload small files and small videos.
    I cant upload anything bigger than say 200mb

    I had this working and accepting larger files then I had a restore done on website.

    I have changed the PHP.INI…

    Is there any reason why just large files don’t work ?

    do I need to edit the hta.access file ?


  2. Ian says:

    .htaccess method worked for Media Temple grid hosting, others didnt affect it, just in case anyones wondering…

  3. Jay says:

    (In my case the problem was with WP MULTISITES)..,

    1. check your hosting limits (although this was not my problem) make sure your hosting allows the limit you are trying to set ie if on a shared hosting you might find the maximum is 64M.

    NOTE: The following solution may also apply If in WordPress, Maximum upload file size will not change even when changed in the php.ini file etc.

    The 1M max upload problem lies with WP MULTISITES default settings!!

    To change this, do the following to change the Maximum upload file size within WP admin:

    1. At the top, hover over My Sites and then click Network Admin.
    2. At the left, hover over Settings and then click Network Settings.
    3. Scroll to the bottom of the page and change the Max upload file size to whatever you would like in KB.
    4. Click Save Changes.

    Hope this helps :)

  4. AmanDeep Singh says:

    Working !.I use Create or Edit an existing PHP.INI file method and after applying the settings as mentioned in the article now i am able to upload themes and plugins which are large in size.Thanks for sharing solution.

  5. Judy says:

    I am new to WordPress, I usually use Joomla but I have a new client that wants a WordPress site. When trying to upload images the WordPress message was that the file limit was 3Mb. I spent hours searching websites for an answer. I am using WAMP and localhost to create the site. Through localhost phpinfo() I could verify which php.ini was active, the one in Apache. I had a file limit of 64Mb but still WordPress had a 3Mb limit. This site gave the instructions under #3 to edit the .htaccess file in the WordPress folder. I copied and pasted the text into this file and IT WORKED! Thank you wpbeginner.

  6. KenSanDiego says:

    forgot to mention, my WP site is in a subdirectory with a domain pointer. Powweb’s php applies to everything in all subdirectories. So if you have any installations in subdirectories the change applies to all installations.

  7. Ugyen Zangmo says:

    Create php.ini in wp-admin folder

    In the file put the following 3 lines:

    upload_max_filesize = 2048M
    post_max_size = 2048M
    max_execution_time = 3000

    Goto to your website as admin and check the upload new media page, it should now display Maximum upload file size: 2 GB.

    Thanks to Yasir Imran for sharing your tip!

    This worked for me. Thank you James for sharing the Yasir Imran tip. Cheers

  8. dominio público says:

    post_max_size should be larger than upload_max_filesize to allow room for other information. The defaults are 2MB max file size and 8MB max post size.

    From PHP’s documentation:

    post_max_size integer
    Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.

  9. Nori says:

    Thanks for this! Tried the php.ini and I am quite surprised it worked and was so easy

  10. Dan says:

    php.ini file worked perfectly for me. I simply changed the existing values to 100M. All good. Thanks for the advice.

  11. James says:

    Create php.ini in wp-admin folder

    In the file put the following 3 lines:

    upload_max_filesize = 2048M
    post_max_size = 2048M
    max_execution_time = 3000

    Goto to your website as admin and check the upload new media page, it should now display Maximum upload file size: 2 GB.

    Thanks to Yasir Imran for sharing your tip!

  12. Zain says:

    Please tell me the names of best themes for softwares/download sites?
    i am waiting.

  13. Markus Aurelius says:

    Nothing of the above worked for me on GoDaddy so I had to use .user.ini instead of php.ini and that worked fine. Thanks for pointing me in the right direction!

  14. sam says:

    1:- open “C:wampbinapacheapache2.4.9bin” folder and find “php” which is a configuration file and open it in ur notepad and again find “upload_max_filesize” and “post_max_size” and change both and save.

    2:- open “C:wampbinphpphp5.5.12” folder and find “php” and “phpforapache” which are configuration file and open both in ur notepad and again find “upload_max_filesize” and “post_max_size” and change both and save.

    3:- finally restart all services of wamp and enjoy…lov u all

  15. Decb says:

    Hi Guys, I’m REALLY new to this but can you look at what I see when I click to edit the .htaccess file – where do i add the code? at the start? at the end? Do I put my cursor at the begining and click return (then put it in) ??? Please help

    • Gerard ONeill says:

      Deb, it wouldn’t matter where you added it; but make sure its outside of a block. To be safe, just add it at the end.

      However, the better way (as of php5.5) is to modify the .user.ini file in a per directory basis. If you did the top level directory, it would apply to all sub directories (unless overridden).

      And obviously the system wide php.ini works too.

  16. BenPDX says:

    +1 for Alex’s solution. Upload php.ini folder to wp-admin folder worked for me on Lithium Hosting. 30 second Google search and 1 min to create text file and upload to server!

  17. Dede Erik says:

    I choice the third method and this is worked to me, thanks so much

  18. Hasan Tareq says:

    .htaccess works for my wpenigne site

  19. Vineesh says:

    Hi alex, you are right. php.ini file should be added to wp-admin folder. It will work perfectly…. thanks alex

  20. Rafael says:

    Just adding the php.ini file into wp admin folder worked perfectly!!! thanks!

  21. chandan says:

    thnx alot Alex this worked for me to..

  22. Tony_atf says:

    I keep getting http error even with your suggestion. im on godaddy I have filesize 300m but anything over 150Mb chokes. it uploads, sits for a few seconds and then the http error displays. wordpress never shows the error.

  23. WPBeginner Staff says:

    You can connect to your website using an FTP client and undo the changes you made.

  24. Nitesh Magan says:

    Hey I added the 1st code to my theme function file, but now everything on my site went blank. I cant even access my wp-admin of my site !!

    Please Help …

  25. Chris says:

    If you’re just trying to upload files yourself in the admin panel (media), make a new plain text document, save it as whatever name (including extension) of the large file you’re trying to upload. So if you’re trying to upload “,” save a blank text document as Upload this blank text file you just created in WordPress. Then, go to FTP or file manager, go to wp-content/uploads/(whatever year it is)/(whatever month it is). You should fine there. Delete that file (which is just a plain text file) then upload the real, making sure the names match up. Then when you go back to media it will be the right file.

  26. Yasir Imran says:

    I tried htaccess method and found 500 internal server error, then placed php.ini with 3 given lines in root directory, again didn’t work. Then I placed it in wp-admin folder and it worked. I think the author should mention it.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.