How To Increase The Maximum Upload Size in WordPress [Step-by-Step]

6 min read
Shares

It is a common problem of every WordPress website having large media files, themes, and plugins. In this article, I will discuss how to increase the maximum upload size in WordPress with the help of 10 possible solutions, so that you can adopt one of the easiest methods.

To verify the allowed upload size, login to your WordPress and navigate to the Media Library. You’ll see an error message with maximum upload size for this site.

You can also check almost all the information including file upload size either by looking under the server dropdown list or Media handling in the Site Heath.

Go to the Site Heath from Tools and

and select info tab.

Media Handling Information
Server Information

1. Contact Your Hosting Provider

If you don’t have the technical knowledge and want to do it more quickly, contact your hosting provider to perform this action. It is one of the easiest and most recommended methods. If you are hosting your website with Temok, our professional support team is just a click away and available 24/7/365.

2. Update Your ‘.htaccess’ File

If you are using a web hosting server with Apache, you can consider adding few lines in the .htaccess File to increase the max upload file size.

Either you can access your server via FTP client (such as FileZilla) or login to your cPanel account and navigate to the folder where you have installed WordPress. Now, open your .htaccess in notepad or code editor and add the lines given below:

You can define max upload size as per your requirements in Megabytes, max execution time, and max input time in seconds. As the name indicates, the execution time defines a time limit spent on a single script to execute.

3. Create or Modify the ‘php.ini’ File

This File can be used to configure any application that runs on PHP, and you can change all the required parameters for upload size, resource limits, and file timeout. So, what you have to do is access your WordPress root directory via FTP or SSH and edit the php.ini File.

Remember, if you cannot view it, you have to create a new file named php.ini File and copy the following code and save it.

4. Change PHP Options via cPanel

If you are using cPanel hosting, then you can easily manage your server and site configuration through its interface. Login to your cPanel and navigate to the “Select PHP Version” under the software section.

You will see extensions and options to change your server’s PHP version.

Click on the “Options” to open the PHP options panel and scroll down to PHP directives such as upload_max_filesize, post_max_size, memory_limit, max_input_time, and max_execution_time and modify them as per your desired values.

If you are using the latest version of cPanel, then there is no need to save changes because it keeps the values automatically; otherwise, you have to click on the save changes button.

5. Increase the Max Upload File Size in Nginx

Nginx is also one of the most popular web servers, and it can handle more concurrent requests than Apache. If you are running your website on Nginx, you need to edit both Nginx.conf and php.ini files. Find the php.ini File at /etc/php/7.4/fpm/php.ini (path depends on the PHP version you have installed)

There is no need to set memory_limit because Nginx handles it differently. Save your Php.ini File and restart PHP-FPM with the help of the given command in your terminal:

Keep in mind; the above line may vary slightly depending on the PHP version you have installed on your server.

Use Nginx’s client_max_body_size directive and update the max upload size limit in the Nginx.conf file that can be found at

You can declare this directive inside one of the given blocks as shown:

Note: This will affect a specific site or application hosted by this server.

Note: This will affect all the sites or applications hosted by this server.

Note: This will affect a specific directory (files, uploads, etc.) inside a site or application.

Save the File and restart your Nginx server with the help of the given command:

6. Use the WordPress’ upload_size_limit’ Filter

The latest WordPress version (above 2.5) introduced the upload_size_limit filter, which is used to filter the maximum upload size allowed in php.ini. WordPress also uses this filter to show you the maximum upload size, like in the Site Health Info screens and Media Library.

The code snippet given above uses WordPress’ manage_options to set this limit only for non-admins. You can easily modify this code to target specific user roles/ids.

7. Theme Functions File

Either you are more comfortable editing WordPress Theme files or cannot access the .htaccess File, then I have the best option for you to change WordPress maximum file upload size using Functions.php File.

Remember, if you will change the Theme then these values will be reverted back to its default values until you again edit the functions.php file of your new theme. Add the following lines in your functions.php file:

8. Use a WordPress Plugin

If you don’t have any access to the code via SSH or FTP/SFTP, you can use any WordPress plugin. Now, install and activate any plugin such as WP Maximum Upload File Size and go to the plugin setting in your WordPress dashboard. Here, you will see a dropdown list from where you can choose your required value.

Remember: This plugin has some limitations, such as you can’t increase the maximum upload file size larger than the one set by your hosting provider.

9. Wp-config.php file

You have another possible way to increase upload size in WordPress by defining size parameters in the wp-config.php file. Access your WordPress root directory using FTP or SSH and edit the wp-config file by adding the following code:

Save this File, and it should also increase the file upload size, but if you are unable to perform this task, you can consider using other possible solutions.

Final Words

WordPress is one of the popular and easiest CMS (Content Management System) so, you can find many possible ways to do something with the help of thousands of plugins. If you are facing any problem on how to increase the maximum file upload size in WordPress then contact us or leave your comment and share your thoughts.

Shares
+3

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Want to Start Hosting on the Cloud or Looking for the Managed Dedicated Servers ? You are on the right Place .....

© Copyright TEMOK 2021. All Rights Reserved.
Shares