Maintenance

How to Increase the WordPress Upload Size Limit and Fix "Exceeds the Maximum Upload Size" Errors

Fix "exceeds the maximum upload size for this site": check your limit, raise it in hPanel or cPanel, use php.ini or .htaccess safely, and fix 413 errors.

How to Increase the WordPress Upload Size Limit and Fix "Exceeds the Maximum Upload Size" Errors
On this page
  1. Where the upload limit comes from
  2. Check your current limit first
  3. Method 1: your hosting control panel (most reliable)
  4. Method 2: a .user.ini or php.ini file
  5. Method 3: .htaccess, on some servers only
  6. Why wp-config.php and most plugins can't raise it
  7. Limits outside PHP: Nginx, Cloudflare and multisite
  8. Other upload errors and what they mean
  9. Upload big files without raising the limit
  10. Do you actually need a bigger limit?
  11. Quick check: see the limit WordPress is using
  12. When to get help
  13. FAQs
Key takeaways
  • WordPress takes its upload limit from PHP, using the smaller of upload_max_filesize and post_max_size, so raise both, ideally in your hosting control panel.
  • php.ini, .user.ini and .htaccess changes only work on some servers, wp-config.php cannot raise the limit, and Nginx, Cloudflare or multisite can add limits of their own.
  • Before raising the limit, check whether the file should be smaller: compressed images, embedded videos and SFTP uploads are often the better fix.

WordPress doesn't set its own upload limit. It reads two PHP settings controlled by your hosting, upload_max_filesize and post_max_size, and uses whichever is smaller. To increase it, raise both in your hosting control panel (PHP Configuration in Hostinger's hPanel, or the MultiPHP INI Editor in cPanel), then check the new figure under Media > Add New. If your panel has no such option, a .user.ini, php.ini or .htaccess file works on some servers, while code in wp-config.php won't help at all.

This guide covers where the limit comes from, each method and when it works, the other limits that cause "413" errors, and how to upload large files without raising anything. If you'd rather not touch server settings, sorting out errors like this is the kind of fix my WordPress maintenance plans handle.

Where the upload limit comes from

PHP settingWhat it controlsExample value
upload_max_filesizeThe largest single file PHP accepts64M
post_max_sizeThe largest total request, including the file and form data; keep it a little above upload_max_filesize72M
memory_limitMemory available to process the upload, such as resizing a large photo256M
max_execution_time and max_input_timeHow long PHP waits, which matters for big files on slow connections300 (seconds)

The example values are a reasonable ceiling for a business site, not a target. Choose a limit a little above the largest file you genuinely need. PHP's own defaults are only 2 MB for a single file and 8 MB for a request, which is why a fresh server set-up often rejects ordinary brochures and theme files.

Check your current limit first

  • Media > Add New shows "Maximum upload file size" under the upload area. This is the effective limit WordPress will enforce.
  • Tools > Site Health > Info lists the individual values in the Media Handling and Server sections, including the upload size, post data size and PHP memory limit.

Note the numbers before changing anything, so you can tell afterwards whether your change actually took effect. Many "it didn't work" moments are a change made in a file the server never reads.

Method 1: your hosting control panel (most reliable)

This changes PHP's settings at the source, and your host's own tools won't break anything else. At the time of writing:

  • Hostinger hPanel: open the website's dashboard, go to the Advanced section, choose PHP Configuration and use the PHP options tab to set upload_max_filesize and post_max_size.
  • cPanel: use the MultiPHP INI Editor under Software, pick your domain and edit the values in Basic Mode. Hosts running CloudLinux may offer Select PHP Version instead, with an Options tab.
  • Plesk: look for PHP Settings on the domain's page.
  • Managed WordPress hosting: PHP settings are often locked. Ask support to raise the limit; many will.

Save, wait a minute, then reload Media > Add New. Menu names change, so check your host's help pages if you can't find the option. If you later switch PHP version, check the values again, because on some panels each version keeps its own settings; updating your PHP version safely covers the switch itself. Budget plans sometimes cap these values, and the only way past a cap is a different plan.

Method 2: a .user.ini or php.ini file

Where PHP runs as FastCGI or PHP-FPM, which is common on shared hosting, PHP reads a file called .user.ini in your site's main folder (the one containing wp-config.php). Some hosts read a file named php.ini there instead. Create the file with your file manager or SFTP and add:

upload_max_filesize = 64M
post_max_size = 72M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300

PHP caches .user.ini files, so a change can take around five minutes to apply. If the numbers in Media > Add New still haven't moved after that, your host ignores the file; delete it and use the control panel or ask support.

Method 3: .htaccess, on some servers only

On Apache servers that run PHP as a module, and on LiteSpeed servers that allow it, these lines in the .htaccess file in your site's main folder change the limits:

php_value upload_max_filesize 64M
php_value post_max_size 72M
php_value max_execution_time 300
php_value max_input_time 300

On servers that don't support php_value, the same lines cause a 500 Internal Server Error and take the whole site down. Download a copy of .htaccess before editing it, check the site straight away, and restore the copy if anything breaks; see fixing a 500 internal server error. A forgotten line here can also cause confusing problems months later, so remove it if it didn't help.

Why wp-config.php and most plugins can't raise it

  • wp-config.php: adding ini_set lines for the upload size has no effect, because PHP doesn't allow upload_max_filesize and post_max_size to be changed once a script is already running. WP_MEMORY_LIMIT, which you may have seen suggested, controls memory, not upload size.
  • Plugins: WordPress's upload_size_limit filter can lower the limit WordPress enforces, but it can't make PHP accept bigger files. Plugins that promise to increase the limit either write the same .htaccess or .ini lines described above, or change only the number WordPress displays.

Limits outside PHP: Nginx, Cloudflare and multisite

If PHP's values are high enough and uploads still fail, something else is in the way:

  • Nginx: its client_max_body_size setting defaults to just 1 MB and produces "413 Request Entity Too Large" when exceeded. Your host needs to raise it in the server configuration, for example to client_max_body_size 64M.
  • Cloudflare: requests through Cloudflare have their own size cap, 100 MB on the free plan at the time of writing. Larger uploads have to bypass the proxy, for example over SFTP. See setting up Cloudflare on WordPress.
  • WordPress multisite: the network admin sets a "Max upload file size" in kilobytes under Network Admin > Settings, on top of PHP's limit. Its default is low, so raise it there too.
  • Security rules: server firewalls such as ModSecurity can block large or unusual uploads with a 403 or a vague error. Your host can check its logs.

Other upload errors and what they mean

What you seeLikely cause
"exceeds the maximum upload size for this site"The file is bigger than the effective limit; raise both PHP values or shrink the file
"The uploaded file exceeds the upload_max_filesize directive in php.ini"PHP rejected the file; raise upload_max_filesize
"The link you followed has expired" when uploading a theme or pluginThe zip is bigger than post_max_size, so the form data was dropped
"413 Request Entity Too Large"A web server or Cloudflare limit, separate from PHP
"HTTP error" or "The server cannot process the image"Usually memory, time-outs or the image library, not size; see fixing the HTTP error on image uploads
"Allowed memory size exhausted" during an uploadPHP ran out of memory; see memory limit errors
"Sorry, you are not allowed to upload this file type"WordPress blocks some file types for security; it isn't a size problem

For other messages, see common WordPress errors explained.

Upload big files without raising the limit

  • Themes and plugins: unzip them on your computer and upload the folder to wp-content/themes or wp-content/plugins over SFTP, then activate them in the dashboard.
  • Media files: upload the file over SFTP, then add it to the Media Library with WP-CLI if your host provides SSH access, as in the example below.
  • Whole-site backups and migrations: importing a large backup through a migration plugin in the browser often hits these limits. Uploading the archive over SFTP, or using your host's migration tool, is usually simpler.
wp media import /home/username/uploads/product-brochure.pdf --title="Product brochure"

Do you actually need a bigger limit?

A higher limit fixes the error, but large files slow pages down and fill your hosting space and backups. Often the better fix is a smaller file:

  • Photos: resize to the size they're shown at and compress them before uploading. A multi-megabyte phone photo usually shrinks dramatically with no visible difference on screen; see image optimisation for WordPress.
  • Videos: upload to YouTube or Vimeo and embed them instead of hosting video files on your server.
  • PDF brochures and catalogues: files exported at print quality are often far larger than a screen needs. Export a web version for the site.

Quick check: see the limit WordPress is using

  1. Open Media > Add New. WordPress shows "Maximum upload file size" under the upload box.
  2. Open Tools > Site Health > Info > Media Handling and compare upload_max_filesize and post_max_size. The smaller one sets your real limit.
  3. Raise both in your hosting panel's PHP settings (many hosts call it "PHP options" or "MultiPHP INI Editor"), then reload the Media page to confirm the new number.

When to get help

Get help when your host will not raise the limit, when you need to import a large site backup, or when uploads fail even under the limit. For a site move, WordPress migration handles large files on the server side. For upload and server errors, see WordPress maintenance and support, or send the details through the contact form.

FAQs

What is the default WordPress upload limit?

WordPress has no default of its own; it uses your server's PHP settings. PHP's built-in defaults allow only 2 MB per file, but most hosts set something higher. Media > Add New shows the limit on your site.

Why didn't my php.ini change work?

Your server may not read that file, it may be in the wrong folder, or PHP may still be using a cached copy. Wait five minutes, check Site Health, and if nothing changed, use the hosting control panel or ask support.

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

No. PHP doesn't allow upload_max_filesize and post_max_size to be changed from inside WordPress, so lines added to wp-config.php have no effect. Change the values in your hosting panel or a server configuration file instead.

Is there a plugin that increases the upload size?

Plugins can't exceed what your server allows. Some write .htaccess or .ini lines for you, which works only where those files are supported. The hosting control panel is more reliable.

How do I upload a file larger than the limit?

Upload it over SFTP or your host's file manager instead of the browser. Themes and plugins can go straight into their folders, and media files can be added to the library with WP-CLI.

Is it safe to set a very high upload limit?

Set it to what you need rather than the maximum. Very high limits let anyone with upload access fill your hosting space, and big uploads tie up server resources on cheaper plans.

Need help with your website?

I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.

Found this useful? Share it:
Contact

Let's build your next website

Available for freelance projects, agency white-label work and long-term maintenance. Feel free to pass this along to your team or company.

I reply within 24 hours, usually the same day. Your details are emailed to me, then WhatsApp opens so we can chat right away.

Chat now