WordPress comes with its own media uploader. It makes uploading files to a blog 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 Hostinger 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 PDF document 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.
What you’ll need
Before you begin this guide you’ll need the following:
- Access to hosting control panel
- Access to WordPress administrator dashboard
Method 1 – 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 yourdomain.com 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.
Method 2 – Configuring php.ini file
IMPORTANT: This method is the most suitable if you host your WordPress on VPS. Many shared hosting providers do not allow editing php.ini file. If you are using shared hosting, contact your hosting support team to make sure you can apply changes to 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.
Method 3 – 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:
- Access cPanel and look for Select PHP version in Software section.
- Click on Change to PHP options.
- Modify the post_max_size and upload_max_filesize values.
- Click on Save button to save the changes.
Method 4 – 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:
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:
By finishing this tutorial you have learned how to increase the maximum upload file size in WordPress, you will be able to upload bigger files from now on.