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

6 min read

It is a common problem for every WordPress website to have 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, log in to your WordPress and navigate to the Media Library. You’ll see an error message with the maximum upload size for this site.

Media Library

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

Tools

and select the 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.

Contact Your Hosting Provider

2. Update Your ‘.htaccess’ File

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

Update Your '.htaccess' File

Either you can access your server via an 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:

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

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.

Create or Modify 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.

upload_max_filesize = 25M
post_max_size = 13M
memory_limit = 15M

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.

Change PHP Options via cPanel

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)

upload_max_filesize = 64M
post_max_size = 128M

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:

sudo service php7.4-fpm restart

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

/etc/nginx/nginx.conf

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

server {
…
client_max_body_size 128M;
}

Note:

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

http {
…
client_max_body_size 128M;
}

Note:

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

Location /files {
…
client_max_body_size 128M;
}

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:

sudo service nginx reload

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.

Use the WordPress' upload_size_limit' Filter

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 to their default values until you again edit the functions.php file of your new theme. Add the following lines in your functions.php file:

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
Theme Functions 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:

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

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.

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.

Make Your Website Live!

Choose Your Desired Web Hosting Plan Now

Temok IT Services
© Copyright TEMOK 2025. All Rights Reserved.