Preguntas técnicas de características y respuestas a preguntas tipo qué es

WordPress Upload_max_filesize Error Fixed in 2026 (Real Fix)

You try to upload a 4 MB PDF to your WordPress media library and instead of the file landing where it should, you get slapped with «The uploaded file exceeds the upload_max_filesize directive in php.ini». It’s a WordPress file upload error that quietly eats hours, blocks client deliverables, and makes you look amateur in front of the people paying you. Let’s kill it properly.

The root cause is boring but important: PHP has its own hard ceiling for how big a single uploaded file can be, and WordPress just inherits it. Your host sets that ceiling in a php.ini file, and most shared hosts ship with a laughably low default like 2 MB. That’s why the file upload limit on WordPress sites feels random — it isn’t. It’s PHP talking.

Why this WordPress file upload error actually happens

Three PHP directives work together, and people usually only fix one of them:

  • upload_max_filesize — the max size of one single uploaded file.
  • post_max_size — the max size of the whole POST request, which must be larger than upload_max_filesize.
  • memory_limit — PHP needs RAM to process the upload, so it has to be bigger than post_max_size.

This is the part most tutorials skip. If you bump upload_max_filesize to 64M but leave post_max_size at 8M, you’ll keep getting errors and you’ll start blaming WordPress, your theme, or the plugin. The WordPress upload_max_filesize error is almost always a mismatch between these three values, not a single broken setting.

Solution 1: Fix php.ini (the real fix)

Connect to your server via FTP or SFTP, or open your hosting file manager, and look for php.ini in the WordPress root folder. If it doesn’t exist, you can create one — many hosts respect a local php.ini per directory.

Open it and set the three values in a coherent order:

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

Notice the logic: memory_limit is the biggest, post_max_size matches or exceeds upload_max_filesize, and max_execution_time gives the server enough time to actually finish writing the file. Without that last one, big uploads on slow shared hosting can time out halfway and corrupt the file. That’s a silent killer nobody warns you about.

Save, then restart PHP — on Apache that means restarting the service, on some panels you just need to wait or clear the PHP-FPM pool. If you don’t restart, nothing changes and you’ll swear the fix didn’t work.

Solution 2: .htaccess override (only on Apache with mod_php)

If you can’t touch php.ini, the .htaccess route is the classic fallback. Open .htaccess in the WordPress root and add at the end:

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

Here’s the catch that breaks this method for half the people reading: if your host runs PHP-FPM or LiteSpeed (which most modern hosts do in 2026), these lines will throw a 500 Internal Server Error because php_value isn’t allowed outside mod_php. If that happens, remove them immediately and go back to php.ini or the hosting panel. Don’t leave a broken .htaccess sitting there tanking your whole site.

Solution 3: WordPress upload limit via wp-config.php

There’s a WordPress-native way that works even when you can’t reach server files through FTP. Open wp-config.php and add these lines above the «That’s all, stop editing» comment:

define(‘WP_MEMORY_LIMIT’, ‘256M’);
@ini_set(‘upload_max_size’, ’64M’);
@ini_set(‘post_max_size’, ’64M’);
@ini_set(‘max_execution_time’, ‘300’);

This works because WordPress calls these before handling the upload. It’s not a universal miracle — some hardened hosts block ini_set() for security — but it’s the fastest thing to try when a client is breathing down your neck and you can’t wait on support tickets. The WordPress maximum upload size you end up with is whatever the strictest layer allows, so if the server caps it at 32M, no code will push it to 64M.

Solution 4: Check the plugin’s own limit

If the error only shows up when someone submits a form with a file field, the problem isn’t the media library at all — it’s the form plugin. WPForms, Gravity Forms, and Contact Form 7 all have their own file size and file type settings, separate from PHP.

Go into the form settings, find the upload field, and raise the max file size there. But be aware: the plugin limit can only ever be lower than the PHP limit, never higher. If PHP says 2M, setting the plugin to 20M does absolutely nothing. Fix PHP first, then the plugin. That order matters and getting it backwards is why people rage-quit on this error.

Solution 5: Ask your host (and be specific)

If you’ve done all of the above and the WordPress file upload limit is still stuck, the ceiling is enforced at the server or account level and you can’t override it from inside your site. Contact support, but don’t send a vague «uploads don’t work» message. Send this instead:

  • «Please raise upload_max_filesize and post_max_size to 64M for my account.»
  • «Confirm the current values of upload_max_filesize, post_max_size, and memory_limit.»
  • «Tell me if php_value in .htaccess is allowed on this server.»

Specific requests get resolved in one ticket. Vague ones get bounced back with a copy-paste article you’ve already read. Some cheap hosts simply won’t raise limits on shared plans — in that case, changing hosts is the actual fix, not a workaround. I’ve seen people burn a week fighting a host that had hard-capped uploads at 8M to protect shared resources. That’s not a bug, it’s a business decision, and your only move is leaving.

How to verify the fix actually worked

Don’t guess. Go to Media → Add New and look at the «Maximum upload file size» line WordPress prints under the uploader. That number is your true current limit. If it still shows 2 MB, none of your changes took effect — you’re editing the wrong php.ini, the server didn’t restart, or your host is overriding everything from a global config you can’t see.

Also test with a real file close to the limit, not a tiny one. A 100 KB test image proves nothing. Upload a 30 MB file if you set 64M. Half-fixed setups pass small tests and fail on the exact client file that matters, usually five minutes before a deadline.

The WordPress «uploaded file exceeds the upload_max_filesize directive» error isn’t mysterious once you understand it’s three PHP values plus a restart. Fix them in the right order, verify the real number in the media library, and stop losing clients to a setting that takes ten minutes to correct.