How to Increase the Maximum File Upload Size in WordPress

How to Increase the Maximum File Upload Size in WordPress

Learn How to Increase the Maximum File Upload Size in WordPress. Follow our step-by-step guide to adjust your upload limit using PHP settings, .htaccess, and more.

What Is the Maximum Upload Size for WordPress?

When building a website, you must upload different media files like images, videos, themes, plugins, etc. And uploading large files can be a hurdle if the upload file size is set to the minimum. Generally, the maximum upload size in WordPress ranges from 2MB to 150MB, depending on your web hosting settings. Your hosting provider usually sets this limit at the server level to prevent timeouts. The default upload file size on Cloudways is 10MB. You Can Learn How to Install WordPress on a Live Server – Step-by-Step Guide for Beginners

How to Check the Current Maximum Upload Size in WordPress?

To check your WordPress site’s current max upload size limit, navigate to WP Admin → Media → Add New. You will see the current max upload size on the bottom, as shown in the screenshot.

How to Increase the Maximum File Upload Size in WordPress

If the current max upload size limit meets your demand, you can leave it as it is. However, if it doesn’t, don’t fret; there are many ways you can increase the max upload size in WordPress.

How to Increase Media File Maximum Upload Size in WordPress?

These are the best methods for increasing WordPress’s maximum upload size of media files.

  1. Update .htaccess File
  2. Edit functions.php File
  3. Modify wp-config.php File
  4. Using Plugin Method

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.

Open up the .htaccess file in a code editor or Notepad and add the following lines.

php_value upload_max_filesize 64M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
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

Sometimes, you might be unable to access your .htaccess file or be 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.  To access your functions.php file, go to WordPress Dashboard →  Appearance →  Theme File Editor and select Theme Functions file.

How to Increase the Maximum File Upload Size in WordPress

However, remember if you change the theme, the max upload size will return to its default values until you edit the functions.php file of the new theme, as the following code is added to only your current theme.

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

3. Modify 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.

How to Increase the Maximum File Upload Size in WordPress

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

@ini_set( 'upload_max_size' , '20M' );
@ini_set( 'post_max_size', '13M');
@ini_set( 'memory_limit', '15M' );

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

5. 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.

How to Increase the Maximum File Upload Size in WordPress

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.

How to Increase the Maximum File Upload Size in WordPress

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

Leave a Reply