HoganHost blog

[email protected]

How to Increase the Maximum File Upload Size in WordPress

Do you want to increase the maximum file upload size in WordPress. Some times low file upload size limit can stop you from uploading files via media uploader, or install plugins and themes. In this article, we will show you how to easily increase the maximum file upload size in WordPress to fix those issues.

 

How to Check Your Maximum File Upload Size Limit in WordPress?

WordPress will automatically show the maximum file upload size limit when you are uploading images or media. To check it you can simply go to Media » Add New page and you will see the maximum file uplaod size limit for your WordPress site.

 

1: Theme Functions File

There are cases where we have seen that just by adding the following code in theme’s functions.php file, you can increase the upload size:

1
2
3
@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

For this method you will need to access your WordPress site’s root folder by using FTP or File Manager app in your hosting account’s cPanel dashboard.

In most cases if you are on a shared host, then 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:

1
2
3
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, then 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. Edit the .htaccess file in your WordPress site’s root folder and add the following code:

1
2
3
4
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

Increase the Max Upload File Size in WordPress Multisite

If you’re running a WordPress Multisite network, then you can modify the max upload file size for your network.

First, head to your Network Admin dashboard, and then go to Settings > Network Settings screen. Here, scroll down till you find the Upload Settings section. You’ll find the Max upload file size field in this area.

We hope this article helped you increase the maximum file upload size in WordPress.

The default value of Max upload file size in a WordPress Multisite is 1500 KB (~1.5 MB). You can change this to a higher value and click the Save Changes button.

Note: You cannot circumvent the server-level max upload size limit from here. If the limit you set here is higher than the server’s max upload size limit, the server will ignore it. You can use the methods described above to find your webserver’s configuration.

Here, we’ve set the new max upload file size to 131072 KB (~128 MB).

You can also limit the total size of files uploaded to an individual site in the Multisite network. However, it’s disabled by default.

 

Leave a Comment

Your email address will not be published. Required fields are marked *