Skip to main content
Fixes

How to increase file upload size in WordPress

By 09/05/2023February 28th, 2024No Comments

WordPress file upload size

One of the most important things to consider when managing a website on the WordPress platform is the file upload size. WordPress’s default file upload size is usually relatively small, usually between 2MB & 150MB, depending on your web host. This can cause problems for users trying to upload large files such as images, videos, or documents.

In this post, we will explore the importance of file upload size in WordPress and provide a comprehensive guide on increasing it.

Understanding the default file upload size in WordPress

The default file upload size in WordPress is determined by the server’s PHP settings. For example, a typical PHP installation has a default file upload size limit of 2MB. This can be a problem if you need to upload larger files.

To check the current file upload size limit on your website, you can install a plugin called “Media File Size Info”, which will show you the file size limit on the Media Library page. Or you can simply go to Media > Add New, and you will see the maximum file upload size limit for your WordPress website.

find wordpress file upload limit
1
Click add new in media to show the add new media page
2
Here shows the current file upload limit

Methods for increasing file upload size in WordPress

There are several methods for increasing the file upload size in WordPress. The three most common methods are editing the php.ini file, using a plugin, adding to functions.php and modifying the .htaccess file. Each method has its advantages and disadvantages, and in this section, we will explore each method in detail.

4 ways to fix WordPress file upload limit

There are 4 methods to modify or increase the file upload limit. The .htaccess is probably the best way if you are proficient with code and have some experience with .htaccess files.

1. htaccess method

The final method for increasing the file upload size in WordPress is to modify the .htaccess file. (Please see what is .htaccess if you are not sure) The .htaccess file is a configuration file that controls many aspects of the server’s behaviour, including the file upload size limit. To modify the .htaccess file, you must access your server via FTP or cPanel.

Once you have accessed the file, you can add the following code:

php_value upload_max_filesize 64Mphp_value post_max_size 64Mphp_value max_execution_time 300php_value max_input_time 300

2. Create or edit an existing PHP.INI file

Editing the php.ini file is one of WordPress’s most popular ways to increase the file upload size. The php.ini file is a configuration file for PHP, and it controls many aspects of PHP’s behaviour, including the file upload size limit.

To edit the php.ini file, you will need to access your server via FTP or cPanel. Once you have accessed the file, you can change the value of the upload_max_filesize variable. For example, if you want to increase the file upload size limit to 10MB, you would change the value to “10M”.

It’s essential to remember that changes to the php.ini file will affect all the sites hosted on the server, so it’s crucial to be careful when making changes.

In most cases, you will not see a php.ini file in your root directory. If you don’t, create a file called php.ini using Notepad, Notes, Sublime Text, EditPlus or Notepad++ and upload it to the root folder. Edit this file and add the following code:

upload_max_filesize = 64Mpost_max_size = 64Mmax_execution_time = 300
3. Theme functions.php

There are times where we have seen that by adding the following code to your theme’s functions.php file, preferably your child theme’s function.php file, you can increase the upload size:

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

4. Using a plugin to increase file upload size

Another popular method for increasing the file upload size in WordPress is to use a plugin. Several plugins available can increase the file upload size limit in WordPress. Some popular options include the “Increase Upload Max Filesize” and “Simple File Upload Size” plugins.

These plugins are easy to use and can increase the file upload size limit without requiring technical knowledge. However, using a plugin to increase the file upload size limit can cause problems with other plugins and themes, and it’s vital to test the changes before making them live.

Conclusion

In conclusion, increasing the file upload size in WordPress is an important task that can help improve your website’s functionality. Whether you edit the php.ini file, use a plugin, or modify the .htaccess file, it’s essential to understand the potential risks and considerations before making any changes.

By following the steps outlined in this post, you can quickly increase the file upload size in WordPress and ensure that your users can upload larger files without any problems. Additionally, it’s necessary to ensure that your server has enough resources to handle bigger files and keep an eye on the performance of your website after the changes.

Remember to back up your website before making any changes. So there you have it! 4 ways to increase the maximum file upload size in WordPress. Please check our other WordPress fixes, our WordPress maintenance page for care plans or tips on how to speed up WordPress in 10 minutes.

Need a price for a new website instantly

Try our website cost calculator for free and get a price emailed to you.

Leave a Reply