How to Increase the Maximum Upload File Size in WordPress

When you are using a WordPress website, firstly, you need to upload the files so that your site is active and functions properly. There is more than one way to upload your picture, theme, or any other content to your WordPress.

Essentially, There are three ways to upload files in WordPress:

           1) Log in to your hosting provider by using their online file manager

           2) Connect to your server via an FTP client like FileZilla

           3) Upload your media, themes, or plugin files directly through the WordPress Dashboard

To upload anything other than media, themes, or plugins, you can upload them through a file manager. For all normal uploads, navigate to your desired location inside the WordPress Dashboard and choose to add/upload a file.

For example, adding a video, navigate to Media -> Add New or either select the file from your computer or just drag and drop it in the box. Below is the screenshot:

add size in media wordpress

The maximum upload file limit of just 5MB. And this limit is applicable when you need to upload a theme or plugin directly from the WordPress Admin Dashboard. This threshold changes from hosting to hosting though. By default, some even allow only 2MB by def others may allow more.

There are several ways to remove this cap on file size and use the three settings within PHP that should deal with the upload limit. Let’s specify the settings first so that you know what you’re actual.

  • upload_max_filesize : This defines the maximum upload limit for files.
  • post_max_size: This defines the maximum upload limit that will be handled in a POST request.
  • memory_limit: This defines how much memory is allocated for PHP. This number should be equal to or higher than the upload_max_filesize.

Let’s assume we have a 20MB file. We’ll set the upload_max_filesize to 25MB, post_max_filesize to 27MB, and memory_limit to 30MB.

1) Create or Modify PHP.Ini File

PHP.ini consists of PHP configuration for your server. You can search it in the root directory of your server. Navigate to your hosting root directory and search for PHP.in the I file. Because of security reasons, it might not be visible, so don’t forget to check “Show hidden files”.

Open PHP. inthe I file with any text editor and find the three settings to modify them according to your requirement. Let’s use the following numbers for this example

File size to be uploaded: 20MB.

  • upload_max_filesize = 25MB
  • post_max_size = 27MB
  • memory_limit = 30MB

If you are not able to search the php.ini file. There is a solution, you can create with a Right-Clickouse and choose Add New File. Open the new file and paste the three lines above and save it as php.ini.

2) Create Or Modify. Access

.htaccess consists of various configurations for your server. Most hosting providers do not show it. To modify it, check “Show Hidden Files” once again and locate the .htaccthe ess file inside the root directory of your server.

Open it with any editor and paste these three lines at the end of the file where it says #END WordPress:

  • php_value upload_max_filesize 25MB
  • php_value post_max_size 27MB
  • php_value memory_limit 30MB

In case you don’t have to access the .htaccess file, create one and paste the default WordPress .htaccess file attributes and then paste the three lines above to increase the upload limit.

3) Modifying A WordPress File

If the above two methods do not work for you, there is always an alternative. Paste the following 3 lines inside your WordPress files. These lines can be written in the wp-config.php, themes functions.php file, etc., This is not the suggestion to increase the upload file size

@ini_set( ‘upload_max_size’ , ’25MB’ );
@ini_set( ‘post_max_size’, ’27MB’);
@ini_set( ‘memory_limit’, ’30MB’ );

4) Plugin

There is another option if you don’t want to do it manually, you can use the plugin in the WordPress repository. Find the right plugin that is compatible with your current WordPress version. You can use Increase Upload Max Filesize which is compatible with the latest version of WordPress.

Go to Plugins -> Add New, search for the Increase Upload Max Filesize plugin from the top right corner, and install it.

Increase max upload file size

Once the plugin has been activated; go to its settings and enter the desired size for your new upload size.

increase upload maxsize

5) The Last Resort Option

If nothing works, you can contact your hosting provider to increase the file size upload limit on your WordPress application. Cloudways 24×7 support is responsive.