1. Update .htaccess file

If your web server is using Apache and PHP is set as an Apache module, then you can add a few lines of code in your WordPress .htaccess file to increase the max upload size in WordPress.

To access your .htaccess file, connect to your server via FTP client and navigate to the folder where WordPress is installed. Open up .htaccess file in a code editor or Notepad and add the following lines.

  1. php_value upload_max_filesize 64M
  2. php_value post_max_size 128M
  3. php_value memory_limit 256M
  4. php_value max_execution_time 300
  5. php_value max_input_time 300

This will define the max upload size in Megabytes. Replace the numbers as per your requirement. The max execution time and max input time are in seconds. The execution time defines the limit of time spent on a single script. Choose a number that is suitable for your site.

2. Edit Functions.php File

In some cases, you might not be able to access your .htaccess file or you are more comfortable editing WordPress theme files.

You can easily increase the size limits by adding the following lines of code in the functions.php file of your theme.

However, remember if you change the theme then max upload size will return to its default values until you edit the functions.php file of the new theme.

  1. @ini_set( 'upload_max_size' , '64M' );
  2. @ini_set( 'post_max_size', '64M');
  3. @ini_set( 'max_execution_time', '300' );

3. php.ini Option

This is a default file used to configure any application which runs on PHP. This file contains parameters required for file timeout, upload size, and resource limits. Access your WordPress root directory using SSH or FTP and look for a php.ini file. In some cases, this file is not visible to the other option would be to create a new file instead.

Open any text editor and create a new file. Copy the following code and save it as php.ini.

  1. upload_max_filesize = 25M
  2. post_max_size = 13M
  3. memory_limit = 15M

increase upload size wordpress in php.ini file

Now, upload that php.ini file using SSH or FTP inside the same root folder.

4. Increase Upload Size in Multisite

If you are running WordPress multisite, then upload size can be increased from settings. This increase is dependent on your server settings. If your server is set to 20MB you cannot increase WordPress upload size to 25MB. However, if your server is set to 20MB your network setting is set to 15 MB then you can resolve the issue by increasing the upload size to 20MB.

wordpress multisite maximum upload file size

5. wp-config.php File

Another way of increasing the upload size in WordPress is to define the size parameter in the wp-config.php file. To do that, access your WordPress root directory using SSH or FTP and locate a wp-config.php file.

wp-config.php

Open the file in any text editor and add the following code.

  1. @ini_set( 'upload_max_size' , '20M' );
  2. @ini_set( 'post_max_size', '13M');
  3. @ini_set( 'memory_limit', '15M' );

Save your changes and it should increase your file upload size.

6. Using Plugin Method

Not everyone is a fan of writing code or accessing root files using SSH or FTP. For that situation, the plugin comes in handy, and luckily there is a WordPress plugin available for increasing WordPress upload size. The plugin we will be using is the Increase Max Upload Filesize plugin.

increase max upload size plugin

Go to your WordPress Dashboard → Plugins → Add new, search “Increase Max Upload Filesize”, then Install and Activate the plugin. Once installed, go to plugin settings and simply enter the value for upload size.

add upload file size value

Click the Save Changes button to apply the new upload size.

 

Use a WordPress Plugin

Messing with code using SSH or FTP/SFTP is not for everyone. If you’re not comfortable with writing or editing code, you can use a WordPress plugin instead.

WP Maximum Upload File Size plugin
WP Maximum Upload File Size plugin

We’ll be using the WP Maximum Upload File Size plugin here. As of writing this, it’s the only up-to-date plugin on the WordPress plugin repository that helps you get this done.

To get started, install and activate the WP Maximum Upload File Size plugin. Next, go to its settings screen in your WordPress dashboard. Here, you can see the maximum upload file size set by both your hosting provider and WordPress.

WP Maximum Upload File Size settings screen
WP Maximum Upload File Size settings screen

Here, you can see that the maximum upload file size set by WordPress is lesser than that set by your hosting provider. Hence, you can crank it up by choosing the Maximum Upload File Size with the dropdown presented.

Note: If you want to set a max upload file size limit that’s larger than the one set by your hosting provider, it’s not possible to do it via this plugin. For that, you need to contact your hosting provider.

Was this answer helpful? 0 Users Found This Useful (0 Votes)