Severity: Minor · Fix time: Under 5 min · Skill level: Beginner

Upload Exceeds Maximum File Size is a WordPress error that appears in the Media Library when you try to upload a file larger than the current upload_max_filesize PHP setting allows. WordPress displays the exact limit — for example, “The uploaded file exceeds the upload_max_filesize directive in php.ini” — and the upload stops before the file even reaches the server.

This is one of WordPress’s most straightforward errors to fix: the upload limit is a PHP configuration value that can be increased in php.ini, .htaccess, or through your hosting control panel. The default limit on many shared hosting environments is 2MB–8MB — far too low for high-resolution images, product videos, PDF catalogs, or WooCommerce product import files.

Need a quick map of every WordPress error? See our 70+ WordPress Errors Guide → for a categorized reference of every common WordPress issue.

[Image: WordPress media library upload screen showing “File exceeds the maximum upload size for this site” error message next to a failed upload]

How the Upload Size Limit Works

WordPress enforces a chain of PHP configuration values that all affect the maximum uploadable file size. All three must be large enough to allow your intended upload — the smallest value in the chain wins:

  • upload_max_filesize — The maximum size of a single uploaded file. This is the value WordPress quotes in the error message.
  • post_max_size — The maximum size of an entire HTTP POST request. Since file uploads are sent as POST requests, this must be larger than upload_max_filesize. A safe ratio is upload_max_filesize = 64M with post_max_size = 128M.
  • memory_limit — PHP’s memory allocation per script. Must be large enough to handle the upload plus processing overhead. Recommended: 256M.

This is the key distinction between this error and the Link You Followed Has Expired error: the “exceeds max file size” error is enforced by upload_max_filesize and blocks the upload immediately with a clear message. The “link expired” error is caused by post_max_size being too small — the entire POST request is silently discarded before WordPress even sees it, producing a confusing expiration message rather than a direct size error. Both share the same underlying fix (raising PHP limits), but they trace to different settings.

This error is also distinct from Image Upload Failed / Corrupt File, which occurs after the file passes the size check but fails during image library processing.

Check This First — 2-Minute Diagnostic

  1. Check the current limit — Go to Media → Add New in wp-admin. WordPress displays the maximum upload file size just below the upload area.
  2. Check all three PHP limits — Go to Tools → Site Health → Info → Server and look for PHP memory limit, PHP post max size, and the upload limit. Compare all three.
  3. Try a smaller file — Confirm the error is size-specific by trying a file you know is below the limit. If small files upload but large ones don’t, size is confirmed as the cause.
  4. Check hosting control panel — Many hosts offer a PHP Settings panel in cPanel that lets you raise these limits with a UI, no file editing required.
  5. Check for WooCommerce import errors — If this happens during a product or order CSV import, the CSV file is the upload target — raise limits accordingly.

Purpose & Benefits

1. Upload Limits Directly Affect Business Operations

Realistic upload limits matter across most types of WordPress sites. Product photography for WooCommerce stores often involves images over 5MB. PDF price lists and catalogs routinely reach 20MB+. A 2MB default upload limit blocks legitimate business content. Setting appropriate limits is basic site configuration, not optional.

2. The PHP Limit Chain Requires All Settings to Align

Understanding that upload_max_filesize, post_max_size, and memory_limit must all accommodate your uploads applies broadly to PHP configuration. These same settings affect form submissions, WooCommerce order processing, and plugin behavior. Getting all three right once saves repeated troubleshooting.

3. A Reasonable Limit Serves as a Minor Security Layer

Upload limits prevent accidental or malicious uploads of extremely large files that could exhaust server disk space or memory. Setting limits to 64M for files and 128M for POST requests is practical for most sites while preventing single-request resource exhaustion.

Examples

1. Raising Limits via .htaccess

On shared hosting where you can’t edit php.ini directly, .htaccess directives can override PHP settings if the host allows it. Add these lines to the .htaccess file in your WordPress root:

# Increase WordPress upload limits via .htaccess
# Works on Apache with PHP running as mod_php
php_value upload_max_filesize 64M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300

After saving, go to Media → Add New and check whether the displayed limit has updated. If not, your host runs PHP as FastCGI and .htaccess PHP directives are ignored — use the php.ini method instead.

2. Raising Limits via php.ini

If your host provides a custom php.ini (common on cPanel shared hosting), create or edit the file in your WordPress root:

; Increase WordPress file upload limits in php.ini
upload_max_filesize = 64M
post_max_size       = 128M
memory_limit        = 256M
max_execution_time  = 300
max_input_time      = 300

Save the file and reload wp-admin. Check Tools → Site Health → Info → Server to confirm the new values are active.

3. Raising Memory Limit via wp-config.php

For the memory_limit specifically, WordPress provides a constant that can override the PHP setting:

// Increase WordPress memory limit in wp-config.php
// Note: WP_MEMORY_LIMIT cannot raise memory above the server's cap
define('WP_MEMORY_LIMIT', '256M');

// For upload sizes, some hosts also respect these ini_set calls:
@ini_set('upload_max_size',    '64M');
@ini_set('post_max_size',      '128M');
@ini_set('max_execution_time', '300');

Note: WordPress’s WP_MEMORY_LIMIT constant cannot raise memory above the server-level cap your host sets. If the host limits PHP to 128M, this constant won’t achieve 256M — contact them to raise the server limit.

Common Mistakes to Avoid

  • Raising only upload_max_filesize without matching post_max_size — If upload_max_filesize is 64M but post_max_size is 8M, uploads over 8MB trigger the Link You Followed Has Expired error. Always set post_max_size to at least double upload_max_filesize.
  • Adding .htaccess PHP directives when the host uses FastCGI — PHP directives in .htaccess only work with mod_php. On FastCGI or PHP-FPM setups, they’re silently ignored. Verify the result in Site Health after adding them.
  • Setting limits excessively high without purpose — Setting upload_max_filesize to 512M “to be safe” wastes memory on every PHP request. Set limits to a practical maximum for your actual use case — 64M covers nearly all image, document, and plugin scenarios.
  • Not verifying the change took effect — Always confirm new limits in Tools → Site Health after making changes. Configuration changes that appear saved may not apply if the wrong config file was edited.

Best Practices

1. Set Practical Upload Limits During Initial Site Configuration

Don’t leave the defaults. As part of WordPress setup, set upload_max_filesize = 64M and post_max_size = 128M immediately. Setting this once proactively prevents upload errors from interrupting content workflows later.

2. Keep post_max_size Always Larger Than upload_max_filesize

post_max_size must be larger than upload_max_filesize because the entire HTTP request — form fields and headers included — must fit within post_max_size. A safe ratio is 2:1. If post_max_size is the smaller value, you’ll see link expired errors instead of (or in addition to) the file size error.

3. Use Your Hosting Control Panel When Possible

Many shared hosting providers offer a PHP Settings panel in cPanel that lets you raise upload_max_filesize, post_max_size, and memory_limit with a dropdown interface. This is preferable to editing php.ini or .htaccess because the hosting UI applies the change at the correct configuration level.

4. Compress Images Before Upload When Practical

Even with generous upload limits, uploading a 30MB unedited RAW photo to WordPress is unnecessary. A practical workflow: export images at the maximum size they’ll actually be displayed at (often 2000px wide at 90% JPEG quality, under 2MB), then let WordPress generate thumbnails. This reduces upload times and PHP memory pressure regardless of the upload limit.

Frequently Asked Questions

What causes the upload exceeds maximum file size error most often?

The default PHP configuration on most shared hosting sets upload_max_filesize to 2MB or 8MB — values that are too small for modern images, PDFs, and plugin updates. The error appears simply because no one has raised the limit since the site was first configured. It’s a configuration gap, not a malfunction.

How do I fix this when locked out of wp-admin?

This error only appears in the media uploader within wp-admin, so it doesn’t prevent login. Connect via SFTP to add directives to .htaccess or php.ini in your WordPress root, or ask your host to raise the PHP upload limits directly.

Can this error hurt my SEO?

Only indirectly. If the error prevents you from uploading important images or documents, your content quality may suffer. The error is confined to the wp-admin interface and has no visibility to search engine crawlers.

What is the difference between this error and “The link you followed has expired”?

Both are caused by PHP upload limits being too small, but they trace to different settings. The “exceeds max file size” error is enforced by upload_max_filesize and blocks immediately with an explicit message. The Link You Followed Has Expired error is caused by post_max_size being too small — the POST request is silently discarded and WordPress shows a confusing nonce error instead.

How high should I set the upload limit?

For most sites: upload_max_filesize = 64M, post_max_size = 128M. For sites handling large videos or high-resolution photography archives, 128M or 256M per file is reasonable. Avoid setting limits higher than your actual use case requires.

Related Glossary Terms

How CyberOptik Can Help

Still broken? Our team fixes WordPress errors like this in under 30 minutes for maintenance clients. Upload limit issues are quick fixes, but they can reveal a broader pattern of under-configured PHP settings that affect performance and reliability across your entire site. Our WordPress maintenance plans include PHP environment reviews and proactive configuration to prevent common errors from interrupting your workflows. Contact us to get your upload limits set correctly or explore our managed hosting options.