How to Increase the Maximum Upload File Size in WordPress

Getting an error for exceeding the maximum upload size for your WordPress website? This article will help you to resolve this issue. 

The maximum upload size depends upon the web hosting provider’s setting. The server-side sets a limit to upload a file so that your website doesn’t overflow with media files and your server doesn’t come to halt.

WordPress will automatically show the maximum file upload size limit when you are uploading images or media. For checking the maximum upload file size limit you can go to Media >> Add New from your WordPress dashboard.

In this article, we will show you how to increase the maximum upload file size in WordPress in the following ways.

  • Changing upload settings in Multisite WordPress websites.
  • Modification in Server Setting through C-panel.
  • Modification in Server Setting through files.
  • Using Plugin.

Changing Upload Settings in Multisite WordPress Websites.

You can easily change the limit for uploading files in Multisite WordPress websites. The control of the maximum file upload size is dependent on your server-level settings.

For example, The server setting has a limit of 40 MB. But you attempt to set a limit of 64 MB in the upload settings of your website, it won’t work. It works when a given condition will be reversed.

For changing upload settings in your Multisite WordPress websites login to your WordPress dashboard. From your dashboard go to My Sites >> Network Admin >> Settings.

Image Credits: Cloudways.com

In the upload settings page scroll down to the “Max Upload file size” option. You can increase the upload size to something higher than the default of 1500 KB (1.5 MB). Then click “Save Changes.”

Image Credit: Cloudways.com

Increasing Upload Size from Cpanel

The Cpanel of the website provides a user interface through which it is convenient to change the upload file size limit. Once you login to your Cpanel, find the PHP configuration settings, and open it.

On the settings page select PHP Options. Scroll down and change the upload_max_filesize option and Click Save.

Modification in Server Files

You can change the maximum upload limit by using the given three directives while modifying the server settings.

  • upload_max_filesize – Defines the maximum upload limit for files.
  • post_max_size – Defines the maximum upload limit which will be handled in a POST request.
  • memory_limit – Defines hoe much memory should be allocated for PHP.

Note that memory_limit should be equal or higher than the upload_max_filesize. Consider the example: You have to upload a 40 MB file. Then you should set the upload_max_filesize to 42 MB, post_max_size to 43 MB and memory_limit to 45 MB.

Here are the files which could be either created or modified to increase upload limit. </p>

  1. .htaccess file
  2. php.ini
  3. wp-config.php

From the given options, some may not work for you as it is dependent on your server setup. Remember to create a copy of the file before modifying them.

NOTE: If you are using shared hosting plan , then these techniques may not work. In that case, you would have to contact your web hosting provider to increase the limit for you. Also, it is recommended to make a copy of these files before modifying them.

Modifying .htaccess file

.htaccess is a core file that is used for adding, modifying, and overriding server-side configuration, performance parameters, and security. It is a default file that comes along WordPress installation and is located in the root directory. Modifying the .htaccess file is convenient if your web server is using Apache and PHP.

For modifying the .htaccess file, you need to login to your cpanel dashboard and go to the root directory of the server. Once you locate the root directory, you will find the .htaccess file in it. You can either edit the file via the online editor, or you can download the file and then modify it via any text editor available locally on your PC. Copy and paste the following three line code before the line #END WordPress and save file.

php_value upload_max_filesize 256M
php_value post_max_size 300M
php_value memory_limit 300M

The Maximum upload file size is set from to 256 MB.

NOTE: If you get an “internal server error” message with the method above it is most likely your server is running PHP in “CGI mode,” which means you can’t use the above commands in your .htaccess file.

Creating or Editing a php.ini file.

php.ini is used to configure applications running over PHP. It is read when PHP starts and is located in root directory of server. Login to your website’s cpanel dashboard and go to your root directory. Locate the php.ini file. If not visible, create a new file, add the following three line code and save it .

upload_max_filesize = 64M
post_max_size = 67M
memory_limit = 70M

Modifying wp-config.php file.

<p>Editing wp-config.php can be used in extreme cases when other two options fail to resolve your issue. The ini_set() PHP function is used for increasing the max upload size of files. For increasing the maximum upload file size via this method, login to your cpanel dashboard and open wp-config.php file located in your root directory. Add the following three line code in the wp-config.php file and save it.

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

NOTE: If you are editing the above three files locally on your computer, then you need to upload the modified files back to your server. Also, delete the respective old files. We also highly recommend you to take a complete backup of your website before making any changes.

Modifying Theme’s functions.php file

If you are hesitant for making any changes in your server files, then you can use this method as well. For modifying the functions.php file, login to your WordPress dashboard and go to Appearance >> Theme Editor. In the theme editor screen, you will see the functions.php file under the theme files column. Add the following code in your functions.php file and save it.

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

Increase Maximum Upload File Size Plugin

If you are a beginner then we recommend you to use this method for increasing the upload size. You can easily change the maximum file upload size without writing a single line of code with the help of Increase Upload Max File Size Plugin.

You can increase the upload file size limit to any value with one click through this plugin. It automatically detects and displays the upload limits set by WordPress and by the server or hosting provider. Login to your WordPress dashboard, and go to Plugins >> Add New. Install and activate the plugin.

Upon Activation, you can access the plugin’s settings from the main WP admin menu – Upload Filesize. You can change the Max Upload Filesize, but you have to consider the server-side setting. The server adjusted limits can’t be changed from a WordPress Plugin.

Maximum upload file size is set from 40 MB to 256 MB using WordPress Plugin.

If any of the above mentioned method don’t work for you. we recommend you to contact your hosting provider and get your maximum upload file size increased.

We hope this article helps you to improve maximum upload file size in your WordPress website. If you have queries you can leave a comment in the comment section below.

Also, if you want us to cover any specific topic, you can drop that into the comment section as well.

Recent Articles

How to Add Tabs to WordPress Posts and Pages

Tabs effectively organizes the content and engages the user. You can divide your posts into tabs in order to save space and...

How To Check Whether Someone Blocked You On Instagram

All social media platforms including Instagram do not notify people when they get blocked by a user. But when someone’s post and...

Free Apps Make Money through These Innovative Ways

Have you always wondered why are some apps available to you free of cost? If you want to know how apps make...

How To Completely Remove Google Account From Chrome Browser

Google Chrome when used with your personal Google account lets you keep the data in sync with all your devices. Your YouTube...

How To Know If Your Android Smartphone Is Hacked And How To Fix It!

One of the worst nightmares you can ever witness is realizing that your Android Smartphone Is Hacked. Yes, you're allowed to be...

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here