TutorialTroubleshooting

How to Increase the Maximum Upload File Size in WordPress

Seeing “The uploaded file exceeds the upload_max_filesize directive in php.ini”? Learn what controls the maximum upload file size in WordPress and six safe ways to increase it, plus alternatives for very large files.

How to increase the maximum upload file size in WordPress
Share

You try to upload a theme, a plugin, a large image or a backup, and WordPress stops you with a message like:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

Or the Media Library simply says “Maximum upload file size: 2 MB” and your file is bigger than that.

The good news: you can usually increase the maximum upload file size in WordPress in a few minutes. In this tutorial, you’ll learn where the limit comes from, how to check it, and six safe ways to raise it, from your hosting control panel to a quick edit in php.ini.

What Controls the Maximum Upload File Size in WordPress?

WordPress doesn’t set the upload limit itself. It reads it from PHP, the language WordPress runs on. Three PHP settings work together:

Setting What it controls
upload_max_filesize The largest single file PHP will accept.
post_max_size The largest total amount of data in one request, including the file and form fields.
memory_limit How much memory a PHP script may use while processing the upload.

The golden rule: memory_limit should be at least as large as post_max_size, and post_max_size should be at least as large as upload_max_filesize.

If post_max_size is smaller than upload_max_filesize, large uploads will still fail, often without a clear error. Many hosts set very low defaults, such as 2MB or 8MB, which is why the maximum upload file size in WordPress is a common problem on new sites.

Two other settings can also stop large uploads:

  • max_execution_time and max_input_time: how long PHP waits before giving up. Slow uploads of big files can time out.
  • Web server limits: on NGINX servers, client_max_body_size can block uploads before PHP even sees them. Only your host or server admin can change this.

How to Check Your Current Upload Limit

There are two quick ways to see your maximum upload file size in WordPress:

In the Media Library: Go to Media → Add New Media File. Below the upload box you’ll see “Maximum upload file size: X MB.”

In Site Health: Go to Tools → Site Health → Info, open the Media Handling section and find Max size of an uploaded file. Then open Server to see Upload max filesize, PHP post max size and PHP memory limit.

Note these numbers so you can confirm your changes later.

6 Ways to Increase the Maximum Upload File Size in WordPress

Start with Method 1 if you’re on shared hosting. Check Site Health after each method. If the number doesn’t change, try the next one.

Before you start: Back up your site, or at least download a copy of any file you edit. A typo in a configuration file can make your site show an error until it’s fixed.

Method 1: Use Your Hosting Control Panel (Easiest)

Most hosts let you change PHP limits without editing any files. This is the safest way to increase the maximum upload file size in WordPress.

On cPanel hosting (MultiPHP INI Editor):

  1. Log in to cPanel and go to Software → MultiPHP INI Editor.
  2. Select your domain from the dropdown.
  3. Set upload_max_filesize to 128M.
  4. Set post_max_size to 128M (or higher).
  5. Make sure memory_limit is at least 256M.
  6. Click Apply.

On cPanel with CloudLinux (Select PHP Version):

  1. Open Software → Select PHP Version and click the Options tab.
  2. Change upload_max_filesize, post_max_size and memory_limit. Each change saves automatically.

On other hosts: Look for PHP Configuration, PHP Options or PHP Settings in your hosting dashboard. Hostinger’s hPanel and Plesk both have one. Some managed WordPress hosts ask you to contact support instead.

Method 2: Edit php.ini (VPS, Dedicated and Local Sites)

If you manage your own server or a local development site, edit PHP’s main configuration file.

  1. Find the file using the Loaded Configuration File line in a phpinfo page. Our guide Where Is php.ini in WordPress? shows how.
  2. Open php.ini and find these lines (search for each one):
upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300
  1. Change the values and make sure no line starts with a semicolon (;), which would turn it into a comment.
  2. Save the file and restart PHP:
sudo systemctl restart php8.3-fpm

Replace 8.3 with your PHP version. On XAMPP or MAMP, stop and start the servers from the control panel. In Local, restart the site.

Method 3: Create a .user.ini File (Many Shared Hosts)

Hosts that run PHP as FastCGI or PHP-FPM often read a .user.ini file in your site’s root folder.

  1. In the folder that contains wp-config.php, create a file named exactly .user.ini.
  2. Add:
upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 256M
max_execution_time = 300
  1. Save the file and wait up to 5 minutes, because PHP caches .user.ini files.

If you can’t see the file afterwards, turn on Show Hidden Files (dotfiles) in your File Manager settings.

Method 4: Create a php.ini File in Your Site Folder

Some hosts, especially older cPanel setups, read a php.ini file placed in your site’s root folder.

  1. Create a file named php.ini in the same folder as wp-config.php.
  2. Add the same lines as in Method 3.
  3. Save it, then check Site Health.

If the values don’t change, your host doesn’t support this method. Delete the file and use Method 1 or Method 3.

Method 5: Edit .htaccess (Apache With mod_php Only)

If your server runs PHP as an Apache module, you can set the limits in .htaccess.

  1. Open .htaccess in your WordPress root folder.
  2. Add these lines outside the # BEGIN WordPress and # END WordPress markers:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
  1. Save and reload your site.

⚠️ Warning: On servers that use PHP-FPM or FastCGI, these lines cause a 500 Internal Server Error. If that happens, remove them straight away and use another method.

Method 6: Ask Your Hosting Provider

If none of the methods above work, your host may enforce a fixed maximum on your plan. Contact support and ask them to raise upload_max_filesize and post_max_size for your site. It’s a routine request and usually takes minutes.

What about plugins? Some plugins promise to increase the maximum upload file size in WordPress. They can only work if your server allows the change, and most simply write to .htaccess or .user.ini for you. The methods above are more reliable.

Which Method Should You Use?

Your hosting Best method
Shared hosting with cPanel Method 1 (MultiPHP INI Editor)
Shared hosting without cPanel Method 3 (.user.ini), then Method 6
Managed WordPress hosting Method 1 if available, otherwise Method 6
VPS or dedicated server Method 2 (php.ini)
Local site (XAMPP, MAMP, Local) Method 2 (php.ini)
What you upload Suggested upload_max_filesize
Images and PDFs 32M – 64M
Themes and plugins (.zip files) 64M – 128M
Site backups and migrations 256M – 512M or more
Video files Consider a video host instead (see below)

Keep post_max_size equal to or larger than upload_max_filesize, and memory_limit larger still.

How to Check That Your Changes Worked

  1. Go to Media → Add New Media File and check the new Maximum upload file size.
  2. Or open Tools → Site Health → Info → Media Handling.
  3. Try uploading the file that failed before.

If the number has gone up, you’ve successfully increased the maximum upload file size in WordPress.

Troubleshooting: The Upload Limit Won’t Change

post_max_size is too small. If you only raised upload_max_filesize, raise post_max_size too.

You edited the wrong php.ini. Command-line PHP and web PHP can use different files. Check Loaded Configuration File in phpinfo.

PHP hasn’t picked up the change. Restart PHP on a VPS, or wait 5 minutes for .user.ini changes.

A web server limit is blocking it. On NGINX, a low client_max_body_size causes “413 Request Entity Too Large” errors. Ask your host to raise it.

Your host caps the limit. Many plans have a maximum you can’t exceed. Ask support or upgrade your plan.

The upload times out. Very large files on slow connections may hit max_execution_time. Raise it, or upload the file another way (below).

Alternatives for Very Large Files

You don’t always need to raise the limit. For big files, these options are often better:

  • Upload by SFTP or File Manager. Upload large theme or plugin folders straight to /wp-content/themes/ or /wp-content/plugins/, then activate them in WordPress.
  • Add files to the Media Library from the server. Plugins such as Add From Server or Media Sync register files you’ve uploaded by SFTP.
  • Host videos elsewhere. Upload videos to YouTube or Vimeo and embed them. Your pages load faster and your hosting space lasts longer.
  • Compress images first. Resize and convert images to WebP before uploading. See our guide on WebP vs. PNG vs. JPEG.
  • Use your migration plugin’s own import option. Many migration plugins can restore a backup from a file uploaded by SFTP.

Frequently Asked Questions

What is the default maximum upload file size in WordPress?

WordPress uses your host’s PHP settings, so it varies. Many hosts default to between 2MB and 128MB.

How do I fix “The uploaded file exceeds the upload_max_filesize directive in php.ini”?

Raise upload_max_filesize and post_max_size using your hosting control panel, php.ini, .user.ini or .htaccess, as shown above.

Can I increase the upload limit in wp-config.php?

Not reliably. wp-config.php can raise WordPress’s memory request, but the upload limit is set by PHP. Use one of the methods in this guide instead.

Why does my upload still fail after increasing the limit?

Check post_max_size, memory_limit and max_execution_time, and ask your host about web server limits such as NGINX’s client_max_body_size.

Is it safe to set a very high upload limit?

Moderately high limits are fine. Extremely high limits let very large requests reach your server, which can strain resources. Set what you need, not the maximum possible.

  • How to Increase Maximum Upload File Size in WordPress, by Website Learners: a popular step-by-step walkthrough.

youtube.com/watch?v=vcogQqelVao

  • How to Increase Maximum Upload File Size in WordPress (No Coding, Easy Method), by WP Wiki – Digital Web Tutor: a no-code approach.

youtube.com/watch?v=Q9FbyBflPsQ

  • How to Increase Upload File Size for WordPress Migration in 3 Steps, by Easytorial: raising the limit for migrations.

youtube.com/watch?v=t0YF4ctI3Ns

Conclusion

The maximum upload file size in WordPress comes from PHP, not WordPress itself. To raise it:

  1. Check your current limit in Media → Add New or Site Health.
  2. Raise upload_max_filesize and post_max_size together, with memory_limit above both.
  3. Use the right method for your hosting: control panel, php.ini, .user.ini or .htaccess.
  4. Confirm the new limit and retry your upload.

For very large files, uploading by SFTP or using a video host is often the better choice.

Don’t Want to Touch Server Settings? Let Our WordPress Developers Help

Upload limits, timeouts and migration errors can be frustrating, especially when one wrong line takes your site offline. At Unitedtheme, we offer professional WordPress development services: configuring PHP correctly for your hosting, handling large migrations, moving media to the right place and keeping your site fast. Hire Unitedtheme’s expert WordPress developers and let us take care of it.

Official References

Keep Your WordPress Site Healthy, Every Month

Server settings, PHP versions and plugins all change over time. With Unitedtheme’s WordPress care plans and retainers, our team looks after your site on an ongoing basis: updates tested safely, server health checks, backups, security and bug fixes. Explore Unitedtheme’s WordPress retainer plans and let us keep your site running smoothly.

How did you find this article?

Tap a reaction — it helps us write more of what you like.

Unitedtheme Avatar

Written by

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep reading

More from the journal