Every hosting server sets an upload limit to prevent its users from violating the server allotted to them. If you get the upload_max_filesize error while installing a theme, plugin, or even uploading an image, it means the problem is with the upload limit that you have to increase.
In this tutorial, you will learn to fix this error by increasing the default upload limit using different methods. I am going to use cPanel to access different files to edit or upload.
Method 1). Use the .htaccess File.
You have to access the .htaccess file from cPanel and add only one line to it, and you won’t see the upload_max_filesize error after that.
Here are a few steps to follow:
1). Log into your hosting account and open cPanel. Locate the File Manager because that’s where all files are stored for a WordPress site.
2). For most sites, you have to open the public_html directory from the sidebar. Click on it and you can see all files including .htaccess.
3). Right-click on it and select to edit.
4). A popup will show up to confirm that you’re going to edit the file. Click on Edit, and a new tab will show up with all the coding lines available on the .htaccess file.
5). Add the following line at the bottom:
php_value upload_max_filesize 256M
6). Click on save changes from the top-right corner of the editor.
If this doesn’t work, you can increase a few other limits by adding this code:
php_value post_max_size 256M php_value memory_limit 512M php_value max_input_time 180 php_value max_execution_time 180
Method 2). Use the wp-config.php File
Just like locating the .htaccess file, you can find the wp-config.php in public_html which is also called the root directory.
At the top, you will see all folders in the root directory. And you will see all the files.
After searching for the wp-config.php file while scrolling down, right-click and choose the “Edit.â€
Just like before, a popup will show up, and you have to click on Edit to continue.
Here is the code you have to add before the line “That’s all, stop editing! Happy publishingâ€.
@ini_set('upload_max_size' , '256M' );
Save changes, and you’re all set.
Method 3). Use the php.ini File
In most shared-hosting accounts, you aren’t allowed to access this file or update it. However, if you can find it in the root directory, open it to edit and add this code:
upload_max_filesize = 256M post_max_size = 256M memory_limit = 512M max_execution_time = 180
Save changes.
If you can’t find it, it means your hosting company has already set PHP limits that you can increase using the .htaccess file.
Method 4). Contact Your Hosting Customer Support
This is the final solution because even after adding coding lines in different or any of these files, only your hosting company’s customer support can help you.
Sometimes, due to security reasons, a company doesn’t allow its users to increase the upload limit. But they can help you fix the upload_max_filesize error.
I hope you have found a solution to your problem.
Conclusion
Once in a while, we all get an error while managing a WordPress.com site. The upload_max_filesize error is one of the most common errors because it’s related to the server that your hosting company manages.
Increasing the file upload limit might seem tricky to many non-techie people. But if you follow any of the above-mentioned methods, you will easily be able to fix this error.
- Do you need the best wordpress hosting? Check out for our recommendations by clicking here.