When managing a WordPress website, you might encounter this common and frustrating message:
“The uploaded file exceeds the upload_max_filesize directive in php.ini.”
This happens when you try to upload a file like a large theme, plugin, or media asset and your WordPress upload limit isn’t high enough. But the good news is: if your website is hosted on cPanel, you can easily fix this yourself using one of several methods.
This article will walk you through multiple ways to increase the WordPress upload limit no coding expertise required.
Why the Upload Limit Exists in the First Place
Hosting providers set upload limits in server configuration files to:
-
Prevent abuse or accidental server overload
-
Maintain consistent performance
-
Protect against large file uploads that could crash the server
By default, WordPress might be limited to 2MB, 8MB, or 32MB, depending on the server. But many themes, plugins, or media files exceed these sizes.
How to Check Your Current Upload Limit in WordPress
Before changing anything, first see what your current limit is.
-
Log into your WordPress Dashboard
-
Go to Media > Add New
-
You’ll see a note like:
Maximum upload file size: 2 MB
This is the value we’re going to change.
Method 1: Update php.ini via cPanel
php.ini is the main configuration file for PHP. Editing it can raise your upload limit directly.
Steps:
-
Log into cPanel
-
Open File Manager
-
Navigate to the public_html folder (or your site’s root directory)
-
Look for a file named
php.ini
-
If it doesn’t exist, create one
-
-
Add or edit the following lines:
Tip: Make sure
post_max_size
is equal to or larger thanupload_max_filesize
, or uploads might still fail.
-
Save the file and refresh your site.
Method 2: Modify .htaccess File
If php.ini
doesn’t work due to server-level restrictions, .htaccess
is a great fallback. This file controls various server settings, especially for Apache servers (most common in cPanel hosting).
Steps:
-
In File Manager, locate
.htaccess
in your site’s root (public_html
) -
Make a backup of this file first
-
Add the following code to the top or bottom:
-
Save and test by uploading a large file
If your server doesn’t allow overriding PHP values via
.htaccess
, you might get a 500 error. Just delete the lines to undo it.
Method 3: Use wp-config.php
You can also set limits using WordPress’s own configuration file.
Steps:
-
In File Manager, open the
wp-config.php
file in your site’s root folder -
Add the following line just before the line that says
/* That's all, stop editing! */
:
-
Save the file and check your WordPress Media section again
Bonus Method: Use cPanel’s MultiPHP INI Editor (If Available)
Some cPanel environments offer an interface for editing PHP limits directly, without touching files.
Steps:
-
Log into cPanel
-
Open MultiPHP INI Editor (under “Software”)
-
Select your domain
-
Modify the following values:
-
upload_max_filesize = 64M
-
post_max_size = 64M
-
memory_limit = 128M
-
-
Click Apply
This is the easiest and safest method if your cPanel has it.
How to Test if the New Limit Works
Once you’ve made changes:
-
Log into WordPress
-
Go to Media > Add New
-
You should now see a larger maximum upload size
-
Try uploading your large file to confirm
If it still fails:
-
Double-check file edits
-
Clear your browser cache
-
Check error logs in cPanel (under Errors)
Best Practices and Tips
-
Only raise limits as much as needed avoid setting values like
512M
unless necessary. -
If you’re uploading videos or large PDFs, consider hosting them externally (e.g., YouTube, Vimeo) to save space.
-
Always keep a backup of
php.ini
,.htaccess
, andwp-config.php
before editing. -
If you’re still limited, your hosting provider might enforce stricter rules. Contact support and request a limit increase.
Final Thoughts
Raising your WordPress upload limit in cPanel is straightforward once you know where to look. Whether you choose the php.ini, .htaccess, wp-config.php, or the MultiPHP INI Editor method, these steps can be performed easily without advanced technical knowledge.
By understanding and applying the correct settings, you’ll never have to worry about “upload_max_filesize” errors again and you’ll have more freedom to build the site you envision.