WordPress offers various themes and plugins that enable you to build just any type of website. WordPress covers all types of websites right from ecommerce to a simple blog. But while selecting a web hosting provider for WordPress, it is important to consider security, performance, and support at first.
In case you are building a WordPress website, hosting a portfolio with a video hosting site with a single media file size of GB or large image files, you won’t be able to upload media files that are larger than 25 MB (in maximum cases).
The most common and untimely occurring error is 500 Internal Server error and users immediately search on the ways to get their WordPress website online.
Basically, the maximum file size that you can upload in WordPress ranges from 2MB to 150MB based on the settings of your web hosting provider given by default.
For checking the current max upload size limit in your WordPress site, go to WP Admin → Media → Add New. The current max upload size will be seen on the bottom as shown in the screenshot.
In case the current max upload limit meets your requirement, you can leave it as it is. But if it doesn’t then don’t worry, there are several ways the max upload size in WordPress can be increased. Below are the ways in this tutorial.
Note: In this guide, we have covered all the possible solutions. But some may not work on the several web hosts. In this case, the best solution is to contact your hosting provider.
1. Update .htaccess File
If your web server using PHP and Apache is set as an Apache module, then you can add a few lines of code in your WordPress .htaccess file for increasing the max upload size in WordPress.
For accessing your .htaccess file, connect to your server via FTP client and go to the folder where WordPress is installed. Open up .htaccess file in a code editor or Notepad and add the below 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
With this, the max upload size will be defined in Megabytes. Replace the numbers as per your needs. The max execution time and max input time are mentioned in seconds. The execution time means the amount of time spent on a single script. Select a number as per your site requirements.
2. Edit Functions.php File
You may face a situation wherein you won’t be able to access your .htaccess file or you will find it easy to edit WordPress theme files.
The size limits can be easily increased by including the below lines of code in the functions.php file of your theme.
But don’t forget that after changing the theme, the max upload size will return to its default values until the functions.php file of the new theme is edited.
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
3. php.ini Option
php.ini is a default file used for configuring any application running on PHP. In this file, you will find parameters required for upload size, file timeout, and resource limits. You can access your WordPress root directory using SSH or FTP and find a php.ini file. In some cases, this file won’t be visible and you would need to create a new file instead.
Go to any text editor and create a new file. Copy the below code and save it as php.ini:
1. upload_max_filesize = 25M 2. post_max_size = 13M 3. memory_limit = 15M
Then, upload that php.ini file using SSH or FTP within the same root folder.
4. Increase Upload Size in Multisite
In case you are running WordPress multisite, then you can increase the upload size from settings. The amount of increase depends on your server settings. If your server’s WordPress upload size is set to 20MB you won’t be able to increase it to 25MB. However, if your server is set to 20MB and your network setting is set to 15 MB then you can resolve the issue by increasing the upload size to 20MB.
5. wp-config.php File
Another way to increase the upload size in WordPress is by defining the size parameter in the wp-config.php file. For this, go to your WordPress root directory using SSH or FTP and find a wp-config.php file.
Open the file in any text editor and include the below code:
@ini_set( 'upload_max_size' , '20M' ); @ini_set( 'post_max_size', '13M'); @ini_set( 'memory_limit', '15M' );
Save your changes and this will increase your file upload size.
6. Plugin Method
Not everyone loves writing code or accessing root files using SSH or FTP. In such cases, you can use the WordPress plugin available for increasing WordPress upload size. Here, we will be using the Increase Max Upload Filesize plugin.
Navigate to your WordPress Dashboard → Plugins → Add new, search “Increase Max Upload Filesize” then activate and install the plugin. After that, go to plugin settings and just enter the value for upload size.
Click the Save Changes button for applying the new upload size.
WordPress offers flexibility to its users. There is always a solution to a query. If you don’t find an answer to any of your queries related to WordPress, then you can always go and ask in the WordPress community.