←back to Blog

Increase WordPress max upload size guide featured image with red WordPress Tips label on dark background

How to Increase the WordPress Max Upload Size (Fixes That Actually Work)

You drag a video, a theme ZIP, or a big PDF into the WordPress Media Library and get slapped with “The uploaded file exceeds the upload_max_filesize directive in php.ini.” Or the upload bar just hangs and dies. If you need to increase the WordPress max upload size, the first thing to know is that WordPress isn’t the one limiting you. Your server is.

That single fact explains why half the fixes floating around the internet don’t work. This guide covers where the limit actually lives, the fixes that work on modern hosting, the one popular fix that can take your site down, and how to tell which layer is blocking the upload.

Why Is My WordPress Upload Limit Only 2MB?

The WordPress upload limit comes from PHP settings on your web server, not from WordPress itself. PHP ships with upload_max_filesize set to 2MB and post_max_size set to 8MB by default, according to the official PHP documentation, and many hosts never change those values. WordPress simply reads whichever of those two numbers is smaller and displays it as your limit.

Three PHP settings matter here, and they have to be set in the right order:

  • upload_max_filesize: the largest single file PHP will accept.
  • post_max_size: the largest total request PHP will accept, including the file and every other form field. This must be equal to or larger than upload_max_filesize.
  • memory_limit: how much memory a PHP script can use. PHP’s documentation recommends keeping this larger than post_max_size.

Raise upload_max_filesize to 128MB but leave post_max_size at 8MB, and your real WordPress upload limit is still 8MB. This mismatch is the most common reason a “fix” appears to do nothing.

How to Check Your Current WordPress Max Upload Size

The fastest way to check your WordPress max upload size is to go to Media → Add New Media File in the dashboard, where WordPress prints “Maximum upload file size” under the uploader. For the full picture, open Tools → Site Health → Info → Server, which shows upload_max_filesize, post_max_size, and the PHP memory limit side by side.

Check both screens before changing anything. Site Health tells you which of the two PHP values is the bottleneck, so you know exactly what to raise. If you have WP-CLI access, this one-liner prints the effective limit:

wp eval 'echo size_format( wp_max_upload_size() );'

Run the same check again after every change. Guessing whether a fix worked is how people end up stacking four conflicting config files on one server.

Fix 1: Change PHP Limits in Your Hosting Control Panel

The safest way to increase the WordPress max upload size is through your hosting control panel, because the host applies the change the correct way for your server setup. In cPanel, open Software → MultiPHP INI Editor, pick your domain, and raise upload_max_filesize, post_max_size, and memory_limit. Plesk, DirectAdmin, and most custom panels have an equivalent “PHP Settings” screen.

Sensible starting values for a typical business site:

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

Don’t jump straight to 1GB “just in case.” A huge upload limit invites huge uploads, and a Media Library full of 400MB videos is a backup and storage problem waiting to happen. Set the limit to what the site actually needs.

If your host has no PHP settings screen at all, open a support ticket and ask them to raise upload_max_filesize and post_max_size. Any decent host does this in minutes. If yours refuses or charges for it, that says a lot about the plan, and the shared vs managed WordPress hosting comparison is worth a read.

Fix 2: Use a .user.ini or php.ini File

On hosting that runs PHP as PHP-FPM or CGI, which covers most modern hosts, a .user.ini file in your WordPress root folder is the correct way to override PHP upload limits. Create a file named .user.ini (note the leading dot) in the same folder as wp-config.php and add:

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

The .user.ini change is not instant. PHP caches .user.ini files for 300 seconds by default (the user_ini.cache_ttl setting), so wait five minutes before deciding it failed. Some hosts use a php.ini file in the root folder instead; your host’s documentation will say which one they read.

Can You Increase Upload Size in .htaccess or wp-config.php?

Editing wp-config.php cannot increase the WordPress upload size, and editing .htaccess only works on one specific, increasingly rare server setup. Both are the top recommendations in older tutorials, and both cause more confusion than they solve.

Why wp-config.php doesn’t work

The upload_max_filesize and post_max_size directives are marked PHP_INI_PERDIR in PHP, which means they can’t be changed at runtime with ini_set(). By the time wp-config.php loads, PHP has already accepted or rejected the upload. Lines like @ini_set( 'upload_max_filesize', '64M' ); silently do nothing. Adding WP_MEMORY_LIMIT to wp-config.php raises WordPress’s memory allowance, which is useful for other problems, but it has zero effect on upload size.

Why .htaccess can crash your site

The php_value lines in .htaccess only work when Apache runs PHP as a module (mod_php). On PHP-FPM, LiteSpeed with LSAPI in many configurations, or any Nginx server, those lines are either ignored or trigger a 500 Internal Server Error that takes the entire site offline. If you try the .htaccess method and the site goes blank, remove the lines immediately. The WordPress critical error fix guide covers recovering from exactly that kind of breakage over FTP.

The honest ranking: control panel first, .user.ini second, host support third. Treat .htaccess as a last resort and back it up before touching it.

Which Upload Size Fix Should You Use?

The right method to increase the WordPress max upload size depends on how your server runs PHP and how much access your host gives you. This table summarizes each option:

MethodWorks OnRiskVerdict
Hosting control panel (MultiPHP INI Editor, PHP Settings)Most shared and managed hostsVery lowBest first choice
.user.ini / php.ini in site rootPHP-FPM and CGI setupsLowBest manual option
Ask host supportAny hostNoneUse when no panel access
.htaccess php_valueApache with mod_php onlyHigh (500 errors)Last resort
wp-config.php ini_set()Nowhere, for upload limitsNone, but uselessSkip it

Still Blocked? Check Nginx, Cloudflare, and Multisite

If PHP limits are raised and uploads still fail, a different layer in front of PHP is rejecting the file. The three usual suspects are the Nginx web server, a proxy or CDN like Cloudflare, and the separate upload setting in WordPress Multisite.

413 Request Entity Too Large (Nginx)

A “413 Request Entity Too Large” error on WordPress uploads usually comes from Nginx, which caps request bodies at 1MB by default through the client_max_body_size directive. Nginx rejects the upload before PHP ever sees it, so no PHP setting can fix it. On a VPS, add this to the http, server, or location block and reload Nginx:

client_max_body_size 64M;

On shared or managed hosting, you can’t edit the Nginx config yourself, so ask the host to raise client_max_body_size to match your PHP limit.

Cloudflare upload limits

Cloudflare caps the size of a single upload request based on the plan: 100MB on Free and Pro, according to Cloudflare’s documentation, with higher limits on Business and Enterprise. Any file above that fails at Cloudflare’s edge with a 413 error, regardless of your server settings. For files that big, upload through SFTP instead of the browser.

WordPress Multisite’s own limit

WordPress Multisite adds its own upload cap on top of PHP. Go to Network Admin → Settings → Network Settings and raise “Max upload file size,” which is set in kilobytes and defaults to 1500 KB. Multisite uses whichever is lower: this network setting or the PHP limit.

What About “Increase Upload Size” Plugins?

Upload size plugins cannot raise the limit past what your server allows. Most of them either write the same .htaccess or .user.ini lines covered above, or use the upload_size_limit filter, which can only lower the WordPress upload limit, never raise it beyond the PHP value. Installing a plugin to write two lines of config is the kind of plugin bloat that causes plugin conflicts later.

The one plugin category that does make sense is chunked uploaders, like Big File Uploads, which split a large file into small pieces so each piece stays under the server limit. That is a real workaround, not a settings wrapper.

Should You Be Uploading Huge Files to WordPress at All?

Most files that hit the WordPress upload limit shouldn’t live in the Media Library in the first place. Large videos belong on YouTube, Vimeo, or a video host like Bunny Stream, where they get proper streaming and don’t bloat your backups or eat your hosting bandwidth.

Images are the other common culprit. A 12MB photo straight from a phone camera should be resized and compressed before upload, not accommodated with a bigger limit. The WordPress image optimization guide covers the right dimensions and formats.

For one-off large files like a plugin bundle or a site backup, skip the browser entirely. Upload the file over SFTP to wp-content/uploads, then register it with WP-CLI:

wp media import wp-content/uploads/2026/09/large-file.pdf

The Bottom Line

To increase the WordPress max upload size, raise upload_max_filesize and post_max_size together through your hosting control panel or a .user.ini file, then confirm the change in Site Health. Skip the wp-config.php trick, treat .htaccess as a last resort, and if you still see a 413 error, look at Nginx or Cloudflare. And before raising the limit at all, ask whether that file belongs in WordPress in the first place.

Frequently Asked Questions

A 2MB WordPress upload limit comes from PHP’s default upload_max_filesize value of 2MB, which many hosts leave unchanged. WordPress doesn’t set this limit; it only displays the lower of the server’s upload_max_filesize and post_max_size values.

Fix the upload_max_filesize error by raising both upload_max_filesize and post_max_size to a value larger than your file, either in your hosting control panel’s PHP settings or in a .user.ini file in the WordPress root folder. If you can’t do either, ask your hosting provider to raise the limits.

No. The upload_max_filesize and post_max_size PHP settings can’t be changed at runtime with ini_set(), so adding them to wp-config.php has no effect on the WordPress upload limit. Use your hosting control panel or a .user.ini file instead.

A 413 Request Entity Too Large error in WordPress means the web server or a proxy rejected the upload before PHP received it. The most common cause is Nginx’s client_max_body_size directive, which defaults to 1MB; Cloudflare’s per-request upload limit can also trigger it on very large files.

A 64MB WordPress max upload size is enough for most business sites, covering images, PDFs, and plugin or theme ZIP files. Larger files like videos are better hosted on a dedicated video platform or uploaded over SFTP rather than through the Media Library.

Leave a Reply

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