In the process of using WordPress, you may encounter an error related to the file size limit to be uploaded. Depending on the hosting company, you will be limited in file size when uploading in WordPress.
Most companies use the default WordPress upload size of 2MB. This size is definitely not enough in many cases.
Therefore, you may encounter errors when uploading large files. In this article, I will share with you a few ways to increase the file upload size in WordPress. If you are not technically proficient, you can ask the technical staff of the hosting company to help you increase the file upload size.
Contents
Increase file upload size in WordPress
Here are a few ways you can use to increase file upload size. You can choose whichever way you find easiest.
Using cPanel
This is the easiest way because you don’t have to touch the code like the way below. Previously, I had an article on how to upgrade PHP to PHP 7.1 version . In that article, I guide you to configure the PHP options section as below:

Here I increase the maximum file upload size to 128MB. You can change the yellow value according to your need.
If your cPanel does not support this capability, you can apply the following methods:
Edit the file php.ini
If you are using a shared host, this file will not be in your web directory. So you need to create a PHP.INI file there. After creating the file, paste the following line of code and save it:
|
1
2
3
|
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
|
Edit .htaccess file
Use an FTP client like FileZilla to access the .htacess file. Paste the following line of code into the .htaccess file and Save the file
|
1
2
3
4
|
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
|
Edit the file functions.php
This way we will add the code to the functions.php file of the theme you are using. Remember to create a child theme before changing the funcitons.php file.
Now access the WordPress dashboard. Then go to Appearance->Editor . Click on the functions.php file and paste the following line of code
|
1
2
3
|
@ini_set( ‘upload_max_size’ , ‘128M’ );
@ini_set( ‘post_max_size’, ‘128M’);
@ini_set( ‘max_execution_time’, ‘300’ );
|
Then save the file. You can adjust the value to suit your situation.
Those are all ways to help you increase the file upload size.
If you know any good tips on increasing the maximum file upload size in WordPress, please share in the comments section below.
Also, if you find your tutorial useful don’t forget to share the article with your friends.

