WPLounge

How to increase the upload_max_filesize in WordPress

How to increase the upload_max_filesize in WordPress

When trying to upload a theme, plugin or even media files to WordPress, a (too) low file upload size limit can prevent you from uploading files to WordPress. If you’re trying to upload a file that exceeds your upload limit, WordPress will show you a upload_max_filesize error.

In this article we’ll show you some methods to fix this error. However, please note that this may not always work on shared hosting packages. If the methods below do not solve your upload_max_filesize error, you will need to reach out to your hosting party and ask them for help. In most cases, hosting companies are very willing to help.

WPLOUNGE RECOMMENDS..
Divi theme & Divi Builder
Elegant Themes is selling more than
85 premium themes (including Divi!) for only $89!
Check Elegant Themes »
The links above are affiliate links.

Where to find the max filesize limit

Current upload_max_filesize
The upload_max_filesize is shown in the bottom of the “Media > Add New” menu

To find out your current limit for uploading files to WordPress, go to Media > Add New in your WordPress admin panel. As shown in the screenshot on the right, the maximum upload filesize is shown at the bottom of the page. In our example, the maximum upload size is 256 MB. In most cases, this is more than enough for uploading media, plugins and themes. However, it could be that the maximum upload file size on your website is lower. In that case, keep reading! :-)

How to increase the upload_max_filesize

There are a few methods to increase the upload_max_filesize for your WordPress website. We will show you five methods that could get the job done. Again, if none of these methods work, please contact your hosting company. They should be able to help you upload the maximum upload file size.

1: Functions.php

The functions.php file is part of your (currently active) WordPress theme and can be edited by going to Appearance > Editor. We do not necessarily recommend using this method, because it means that if you switch themes, the maximum file size will go back to its original value. However, it is one of the quickest ways to fix the error. Add the following code to your functions.php to increase the upload_max_filesize to 64 MB:

Of course, you can change the number (64) to a higher value if you need to upload a larger file to WordPress.

2: .htaccess

You can also use the .htaccess file to increase the maximum file size. You will need to log in to your WordPress website with an FTP client (like FileZilla). To increase the upload_max_filesize to 64 MB, add the following code to the bottom of your .htaccess file:

3: php.ini

To use this method, again, you will need to log in to your WordPress website via FTP. In the root folder of your WordPress website, look for a file called php.ini. If you cannot find this file, you will need to create a new file called php.ini and upload it to the root folder. Make sure to add the following code to the php.ini file:

Again, if you need a limit higher than 64 MB, just change the number in the code snippet.

4: wp-config.php

The wp-config.php file is the “heart” of your WordPress website. You should therefore be careful when editing this file. To be on the safe side, I recommend to save a copy of the original file before editing it. Adding the following code should increase your upload_max_filesize to 100 MB:

Again, this may not always work when you’re on a shared hosting package. In that case, you will need to contact your hosting company.

5: Using a plugin

Our last method is to use a plugin like Increase Max Upload Filesize. I’m not saying that this plugin is not good, but I do not recommend to use a plugin for solving minor issues like this one. Having lots of plugins makes your website slower and less safe. Therefore, we recommend to only use this method as a temporary fix for increasing the upload_max_filesize.

Rate this article

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Wouter Postma

Co-owner of WPLounge.nl, the biggest Dutch blog about WordPress.

Comment