Lorixen.
EN

'The Uploaded File Exceeds the upload_max_filesize Directive' in WordPress

Short answer: The message comes from PHP, not WordPress. Your server only accepts uploads up to the size set in upload_max_filesize, and the whole request must also fit inside post_max_size. On most shared hosting you raise both in the control panel's PHP settings or in a .user.ini file, then wait a few minutes for the change to apply. Keep post_max_size slightly larger than upload_max_filesize and make sure memory_limit is not smaller than either. If the file is a long video or a huge print-quality brochure, compress it or host it elsewhere instead of pushing the limit up indefinitely.

Where you see the limit

When you drag a file into the Media Library, WordPress shows the current maximum under the upload box as "Maximum upload file size: 8 MB" or similar. If the file is bigger, the upload fails with "The uploaded file exceeds the upload_max_filesize directive in php.ini" or a shorter "exceeds the maximum upload size for this site".

You can also see the values under Tools > Site Health > Info > Server, which lists the PHP version, the upload limit, the post size limit and the memory limit. Note these down before changing anything so you can compare afterwards.

The three settings that work together

PHP checks several limits for every upload. Raising only one of them is why so many "fixes" change nothing.

Setting What it limits Rule of thumb
upload_max_filesize One uploaded file Set to the largest single file you need
post_max_size The whole form submission, all files plus fields Slightly above upload_max_filesize
memory_limit Memory a PHP process may use Not below post_max_size
max_execution_time / max_input_time How long processing and receiving may take Raise a little for slow connections

PHP's own core configuration reference describes each directive. Values are written with a unit letter, for example 64M.

Here is an example scenario: a catering company wants to upload a 40 MB menu PDF and the host default is 8 MB. Sensible values would be upload_max_filesize = 64M, post_max_size = 72M and memory_limit = 256M.

Option 1: the host control panel

This is the safest route and works on most shared plans.

  1. Sign in to the hosting dashboard your provider gives you, whatever brand of panel it uses.
  2. Look for "Select PHP Version", "PHP Settings", "MultiPHP INI Editor" or "PHP Configuration".
  3. Choose the domain or folder of your WordPress site.
  4. Change upload_max_filesize and post_max_size, and check memory_limit.
  5. Save, wait a minute, then reload the Media Library upload screen to see the new figure.

If the panel does not offer these fields, the host may cap the value for your plan. Their support team can tell you the maximum allowed.

Option 2: a .user.ini file

Many hosts run PHP in a mode (PHP-FPM or CGI) that reads small per-folder settings files called .user.ini.

  1. Connect with SFTP or the file manager and open the folder where wp-config.php lives.
  2. Create or edit a file named .user.ini (note the leading dot).
  3. Add the lines you need, for example:
upload_max_filesize = 64M
post_max_size = 72M
memory_limit = 256M
  1. Save. PHP rereads these files periodically, by default every five minutes, so a change may not show instantly. The behaviour is explained in the PHP manual's page on .user.ini files.

On a few older hosts you may have full access to a php.ini file in the site root instead. The syntax is the same.

Why the .htaccess method fails on many hosts

Older tutorials tell you to add php_value upload_max_filesize 64M to .htaccess. That only works when PHP runs as an Apache module. On servers that use PHP-FPM, LiteSpeed in some modes, or Nginx, the line is either ignored or causes a "500 Internal Server Error" that takes the whole site down.

If you tried it and the site broke, remove the line again through the file manager. Then use the control panel or .user.ini instead.

Similarly, adding @ini_set( 'upload_max_filesize' , '64M' ); to functions.php is unreliable. By the time WordPress loads a theme, PHP has already applied its upload limits to the request.

When raising the limit is the wrong answer

A bigger limit is fine for an occasional large PDF. It is a poor fit for some files.

  • Videos. Uploading a 500 MB promo film means visitors stream it from your web server, which is slow and eats bandwidth. Upload it to a video platform and embed it, or use a dedicated video host.
  • Print-quality brochures. A 120 MB PDF made for the printer is wasteful online. Export a "smallest file size" or "web" version from your design tool, which is often a fraction of the size.
  • Photo galleries. Resize images to the largest size the theme displays, usually below 2,500 pixels wide, before uploading.
  • Downloads for clients. Large project files or archives are better shared from cloud storage with a link.

Keeping big files away from WordPress also keeps backups smaller and migrations quicker.

Checking that the change worked

  1. Open Tools > Site Health > Info > Server and confirm the new values.
  2. Go to Media > Add New and check the displayed maximum.
  3. Upload the file that failed before.
  4. If the upload now stalls rather than failing with a message, raise max_execution_time slightly or try on a faster connection.
  5. If you use a security plugin or a firewall service that filters traffic before it reaches WordPress, check whether it has its own request size limit, which would block large uploads even after PHP accepts them.

FAQ

Why does Site Health still show the old value?

Either the setting was applied to a different folder or PHP version, or PHP has not reread .user.ini yet. Wait a few minutes and check which PHP version the site uses in the panel.

Is there a maximum value I should not exceed?

Your host sets the ceiling. Within it, choose the smallest size that covers real files rather than an extreme number.

Can a plugin raise the limit for me?

Some plugins write the same settings into configuration files. They cannot go beyond what the host allows, so the panel is usually more direct.

Will raising the limit slow the site down?

Not by itself. Only large files actually uploaded and served affect performance.

If uploads keep failing after these changes or you want large media handled properly, get in touch with us and we will check what the server is enforcing.

Sources

WhatsAppBook a call