How to Increase Max Upload File Size in WordPress

How to Increase Max Upload File Size in WordPress

WordPress comes with media uploader. It makes uploading files to a site an easy task – there is no need to deal with FTP clients or File Managers. All media files you want to have on your blog can be easily uploaded by clicking just a few buttons.

However, it’s worth to mention, that media uploader uses PHP to upload files to the server and, unfortunately, there is an upload limit for maximum file size. You can quickly check your WordPress upload file limit in WordPress Admin Dashboard -> Media -> Add New section.

This limit can be different depending on hosting provider (for example, on TongoHost the limit is 256MB and can easily increased) or your WordPress configuration. In most cases maximum file upload limit is more than enough for regular WordPress user. But what if you want to upload a high-quality video file or a big file (xlsx, docx, etc) which exceeds this limit? Trying to upload larger files will cause this file exceeds the maximum upload size for this site error.

There are quite a few different ways to increase upload size in WordPress and in this tutorial we will go through them.

First method – Increasing max upload size in .htaccess

Many hosting providers allow changing various PHP settings via .htaccess file. Thus by applying php_value upload_max_filesize rule in .htaccess file you can increase PHP maximum file size upload limit.

We will use File Manager to edit .htaccess file, but the same can be done by using FTP client. You should be able to find .htaccess in the same directory as your WordPress files. For example, if you can access your blog via address, WordPress and .htaccess should be in the public_html folder.

Once you located .htaccess file, select it and click on Edit button.

You need to add the following codes at the bottom of the file:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300

Once you are done save the changes by pressing Save icon at the top left corner.




Second method – Configuring php.ini file

If .htaccess method did not work for you, you could try increasing WordPress upload limit by editing php.ini file. Access your files by using File Manager, FTP client or even SSH (if it’s supported) and look for php.ini file in your root directory. If you cannot see such file, create it and enter the following rules:

upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300

Once you are done save changes and revisit your WordPress admin area –> Media -> Add New section to confirm the change.

Third method – Changing maximum upload size in cPanel

If your hosting provider is using cPanel and allows changing PHP settings, you can easily increase maximum file upload size:

1. Access cPanel and look for Select PHP version in Software section.

2. Click on Change to PHP options.

3. Modify the post_max_size and upload_max_filesize values.

4. Click on Save button to save the changes.

Fourth method – Modifying wp-config.php file

Do not worry if above methods do not work for you. Another way to increase upload limit in WordPress is to add the following line to wp-config.php file:

define(‘WP_MEMORY_LIMIT’, ‘128M’);

Access WordPress files using File Manager or FTP client, locate wp-config.php and amend the above line to the bottom of the file. Once you are done, wp-config.php should look similar to this: