How to Increase Max File Size Upload Limit From 2MB

Snippets by IsItWP

Are you looking for a way to increase the max file size upload limit from 2 MB to 64 MB? While there’s probably a plugin for this, we have created a quick code snippet that you can use to increase the file size upload limit in WordPress.

The default file size upload limit is 2 MB. You can change it to the sample below as 64 MB or any other size.


All you have to do is add this code to your theme’s php.ini file:

upload_max_filesize = 64M

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 62 best free WordPress blog themes and how to create a custom user registration form in WordPress.

Comments  Leave a Reply

  1. Thommy M. Malmström March 29, 2019 at 2:55 pm

    When I’ve set this in my php.ini and restarted httpd and I still can’t upload a 200MB file, what else can I try? Are there other limitations, like in the database?
    upload_max_filesize = 512M
    post_max_size = 512M

    I’m running on a private Fedora 29 server.

  2. Thank you for your help with this ad in.

    I was trying to upload a 6MB plug in and nothing was working with my attempts to change .htaccess file.

    I have no idea why WordPress would not have max file size on one of the standard menus.

  3. It’s good to explain every step in order this to understand meaning of what we submit.

  4. the best option to use is php.ini but many coder or developer just don`t know how to teach other people very simple way of doing it, this is my second time of doing it and I can tell you where you are making the mistake.
    Log into your root server where wordpress is installed and navigate to wp-admin folder and make sure to delete any php.ini file in that folder if any, then open your NOTE-PAD and paste the code below

    memory_limit = 200M
    upload_max_filesize = 200M
    post_max_size = 200M
    file_uploads = On

    now save it as php.ini and upload it to your wp-admin folder, now you can check your wordpress to see the size limit

    important note: php.ini must be in small letters like abcd and not ABCD that is you must save it with php.ini and not PHP.ini that is where most people where having problem, and if you which to change your size again, delete the file and create another one with the same process.

    1. I have been searching one hour for this solution. I didn’t find right way to do that. I just do that and my problem solved. I found lot of solution that’s ain’t work perfectly and need lot of work. Thanks PATRICK for your solution.

  5. Tip. Edit the php.ini. (without a BOM for notepad++)
    search and replace :

    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 300

    and then restart apache.

  6. I tried the trick in my local machine using WAMP server. Afte r changing the line of code in php.ini file, I restarted the server and checked. But it is showing only 8MB max size. When I try to upload 10MB file it is showing “This file exceeds the maximum upload size for this site.”

    1. Try adding “post_max_size 64M” to it as well.

  7. You should probably also change the “post_max_size” to “64M” also. 

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 privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!