Upload Max Filesize Exceeded
Symptoms
You’re trying to upload a file — a theme ZIP, a WooCommerce product image, maybe a quick video — and WordPress slaps you with a size limit error. This happens because your server’s PHP configuration caps file uploads at a value smaller than what you’re trying to push through. The right way to fix this is to change the limit at the server level, not install a plugin for it.
What Causes Upload Max Filesize Exceeded?
- PHP’s
upload_max_filesizeis too low — Most shared hosts default this to 2MB or 8MB. That’s barely enough for a compressed photo, let alone a theme ZIP or short video. post_max_sizeis smaller than the file — This PHP directive controls the total size of POST data. If it’s lower thanupload_max_filesize, the smaller value wins.- Your hosting provider enforces hard limits — Some managed hosts override your PHP settings at the server level. Your
.htaccessorphp.inichanges get ignored silently. - WordPress
upload_size_limitfilter is capped — Multisite installations cap uploads to 1.5MB by default in Network Settings. Single-site installs rarely hit this, but multisite will get you every time. - Nginx or Apache request body limits — If you’re behind Nginx, the
client_max_body_sizedirective can reject the upload before PHP even sees it.
How to Fix It
Step 1: Check Your Current Limits
Before changing anything, confirm what PHP is actually reporting. Add this to a temporary file or use WP-CLI:
wp eval 'echo "upload_max_filesize: ". Ini_get("upload_max_filesize"). "\n"; echo "post_max_size: ". Ini_get("post_max_size"). "\n"; echo "memory_limit: ". Ini_get("memory_limit"). "\n";'
Or go to Tools → Site Health → Info → Server in your WordPress dashboard. The values for upload_max_filesize and post_max_size are listed there.
Write down the current values. You’ll need them to confirm the fix worked.
Step 2: Edit .htaccess (Apache Servers)
This is the fastest fix and works on most shared hosting running Apache. Open your site’s root .htaccess file via FTP or SSH — it sits in the same directory as wp-config.php.
Add these lines before the # BEGIN WordPress block:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
Save and re-upload. If your site throws a 500 error after this, your host doesn’t allow php_value overrides in .htaccess — remove the lines and move to Step 3.
Step 3: Create or Edit php.ini / .user.ini
Some hosts respect a custom php.ini or .user.ini file in your WordPress root directory (same folder as wp-config.php). Create the file if it doesn’t exist.
For php.ini:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M
For .user.ini (PHP-FPM / FastCGI hosts like SiteGround, Cloudways):
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300
Give it a few minutes — .user.ini changes aren’t instant. PHP-FPM caches them for up to 5 minutes by default.
Step 4: Use wp-config.php for the Memory Limit
Open wp-config.php via FTP or SSH and add this line above the /* That's all, stop editing! */ comment:
define( 'WP_MEMORY_LIMIT', '256M' );
This won’t change upload_max_filesize directly — that’s a PHP-level setting — but it prevents WordPress from running out of memory while processing a large upload.
Step 5: Fix Nginx Server Limits
If you’re on a VPS or dedicated server running Nginx, edit your Nginx config (typically at /etc/nginx/nginx.conf or your site’s server block):
client_max_body_size 128M;
Then restart Nginx:
sudo systemctl restart nginx
Skip this if you’re on shared hosting — you won’t have access to the Nginx config. Contact your host instead.
Step 6: WordPress Multisite — Raise the Network Limit
If you’re running Multisite, go to Network Admin → Settings → Network Settings. Find Max upload file size and change it from 1500 (KB) to something reasonable like 131072 (which is 128MB in KB).
Hit Save Changes. This is the one that catches people off guard because all the PHP settings can be correct and Multisite will still block you.
Step 7: Verify the Fix
Run the WP-CLI check from Step 1 again, or revisit Tools → Site Health → Info → Server. The values should now reflect your changes. Try the upload that failed before.
If nothing changed, your host is overriding your settings at the server level. Contact their support and ask them to raise upload_max_filesize and post_max_size to 128M. On managed hosts like Kinsta or WP Engine, this is a one-click change in their dashboard.
Prevention
- Set generous PHP limits from day one. When spinning up a new site, configure
upload_max_filesizeto at least 64MB before handing the site to a client. Skip this if you want headaches later. - Compress media before uploading. Use ShortPixel or Imagify to optimize images locally or on-upload. A 12MB DSLR photo has no business going into your Media Library at full resolution.
- Use a dedicated large-file solution for video. Don’t upload video to WordPress directly. Embed from YouTube, Vimeo, or Bunny Stream. Your server isn’t a CDN.
- Document your server config. Keep a
server-notes.mdin your project repo listing the PHP limits, hosting provider, and any custom overrides. Future-you (or the next developer) will thank you.
Last verified: April 2026
Related reading
- multisite
- WP Engine Review 2026: Is the Premium WordPress Host Still Worth $30/mo?
- Cloudways Review 2026: The Managed Cloud Hosting That Changed My Mind
- Kinsta Review 2026: Premium WordPress Hosting Worth $35/Month?
- Kinsta vs WP Engine (2026): Premium Managed Hosting Compared
- SiteGround Review 2026: Speed, Support, and the 2025 Price Hike Verdict
- WooCommerce Review 2026: The Real Cost of Free Ecommerce on WordPress
- Cloudways vs Kinsta (2026): Cloud Hosting Compared
- Hostinger vs SiteGround: Which WordPress Host Actually Delivers in 2026?
- SiteGround vs Bluehost (2026): Which Budget Host Is Better?
- WooCommerce vs Shopify (2026): Which E-Commerce Platform to Choose?
- dashboard
- media-library
- theme
- wp-cli
- filter
- plugin