Codeable info

Quick Tip: Increase Maximum Upload Size In WordPress

Posted on by in WordPress Tutorials

When uploading images through WordPress the max file size is 2MB, which means when trying to upload anything bigger the user simply gets denied by the application. This can be quite annoying especially when taking image quality into consideration. The higher the image quality, and bigger the image, the larger the overall file size.

Some blogs, that specialize in photography for example, would benefit from a much larger file size limit. However to increase the file size we need to edit important WordPress source files which could potentially harm the application (if the user is not careful), so it’s a good idea to backup the entire WordPress database before continuing just in case.

To continue, we also need proper access to the WordPress install directory, which means we need access to account hosting options. Sadly if you are not the blog owner, you cannot take advantage of this tweak; but if you need the maximum file size increased you could direct your blog owner in the right direction and have them check out this article!

Increase Image Upload Size

In the root WordPress folder is a file called “PHP.ini” which handles standard PHP functions for the WordPress application; this is also the file we need to alter.

Open the file and look for the following line of code:

upload_max_filesize = 2MB

To increase the maximum image file size that can be uploaded we simply need to change the “2MB” in the code above to the desired file size. For instance lets say we would like to increase the maximum supported image size to “32MB” we would simply change the code so it looks like the following:

upload_max_filesize = 32MB

Note: In some cases there may not be a “PHP.ini” file in the main directory of the WordPress install. If that is the case, you need to create the file and copy it to the “wp-admin” directory. WordPress will then automatically move the new .ini file to the proper directory.

After creating a new text file called “PHP.ini” you need to include the following code in the new file:

memory_limit = 32M
upload_max_filesize = 100M
post_max_size = 100M

No matter the method you use to increase the file size make sure to save the altered “PHP.ini” file and upload it to the proper WordPress directory.

After your finished, you should be all set. Check with WordPress to see your new supported file size!

Codeable info

Comments (9)

Comment by Harry Styles says:

Worked like a dream – thanks a million

Comment by Puiu says:

works like a charm. Thanks!

Comment by David says:

fantastic, thanks for info

Comment by Adri @ Amazing Pictures Online says:

Hello Briley,
I always use WordPress for my two blogs and let me tell you, this has always been an issue for me. I’ll use WP Cache sometimes but this will conflict, leaving me with no solution.

I’m so glad I came here because these tips have really helped me. Thanks!

Comment by eliasv says:


1. I did change the following in php.ini:
memory_limit = 32M
upload_max_filesize = 8M
post_max_size = 8M

2. restarted the apache
3. checked that these values are valid, through phpinfo() command

BUT I still see the MAximum uploaded file size: 2MB

Can you please help?

Kind Regards

Comment by eldar says:

great tip! thanks

Comment by Mike says:

Great tips, but if it’s my case, I wouldn’t upload any pictures to WordPress because the more and more pictures you upload to your blog, the worse your blog performance will be later. So, instead of uploading to blog, I upload to a S3. I have heard about using CDN like MaxCDN but I still don’t know how. Do you know about this?

Comment by Pothi says:

Great tip. Unfortunately, I’m on the shared host. So, here is the tip that does the same trick via .htaccess file.

php_value upload_max_filesize 32M

One may replace upload_max_filesize with other keywords as in php.ini file.

Comment by Calítoe.:. (Cristina MJ) says:

Lately, WordPress allows up to 8MB by default, but great tip anyway. Thanks. =)

Codeable info