Guide WordPress

How to increase the WordPress maximum upload size

The upload limit shown in Media, Add New actually comes from PHP settings, not WordPress — raise it in your control panel first.

Updated 6 min read Beginner

The maximum upload size shown at the bottom of the Media, Add New screen is not actually a WordPress setting. It is a report of what PHP allows, and WordPress simply displays whatever number PHP tells it. Raising it means changing PHP's configuration, not anything inside WordPress itself.

Which two PHP settings control it

Two values work together, and the smaller of the two is what actually limits you:

SettingControls
upload_max_filesizeThe largest single file PHP will accept
post_max_sizeThe largest total size of an entire form submission, which must be at least as large as upload_max_filesize for uploads to work correctly

If post_max_size is smaller than upload_max_filesize, the smaller value effectively wins and you will still hit a limit below what you thought you set.

Method 1: your control panel's PHP settings

The most reliable option, since it changes the setting where PHP actually reads it.

  1. Open the PHP configuration section of your control panel

    Look for a PHP settings or PHP configuration option.

  2. Find upload_max_filesize and post_max_size

    Raise both, keeping post_max_size equal to or larger than upload_max_filesize — for example, 64M and 80M.

  3. Save

    This typically takes effect immediately or within a few minutes, with no need to restart anything yourself.

  4. Refresh the Media, Add New screen

    Check the maximum upload size now shown at the bottom of the page to confirm the new value has taken effect.

Method 2: a .htaccess rule

If your hosting setup does not expose a PHP settings screen, or you want the value tied to this specific site rather than the whole account, add these lines to the .htaccess file in your WordPress root:

php_value upload_max_filesize 64M
php_value post_max_size 80M
php_value max_execution_time 300
php_value max_input_time 300

The last two lines are worth including alongside the size limits: a large upload can also take longer to process than PHP's default execution time allows, which produces a timeout rather than a size error even once the size limit itself is raised.

This only works with certain PHP configurations

Whether .htaccess can override PHP settings this way depends on how PHP is running on the server. If adding these lines has no effect and the maximum shown in Media, Add New does not change, your account is likely running a configuration where this method is ignored, and Method 1 or Method 3 is required instead.

Method 3: wp-config.php

WordPress itself cannot override PHP's own limit, but you can set the value WordPress requests, which is worth doing alongside the PHP-level change rather than instead of it. Add to wp-config.php, above the "stop editing" comment:

@ini_set( 'upload_max_size', '64M' );
@ini_set( 'post_max_size', '80M' );
@ini_set( 'max_execution_time', '300' );

The @ suppresses a warning on hosting configurations where this particular setting cannot be changed at runtime, so the line fails silently rather than producing an error on the page. This method has the least reliable effect of the three, because many hosting configurations do not allow ini_set() to change these particular values — treat it as a supplement to Method 1, not a replacement for it.

Checking what is actually taking effect

After trying any of the above, refresh the Media, Add New screen in wp-admin and read the number shown under the upload area. That figure reflects whichever setting genuinely won, regardless of which method you used to attempt the change — if it has not moved, that method did not take effect on your account and you should try the next one.

Uploads still failing after raising the limit

  • Check the actual file size against the new limit. It sounds obvious, but confirm the file is genuinely smaller than what you set — a video file in particular is easy to underestimate.
  • Check for a timeout rather than a size rejection. A large file that starts uploading and then fails partway through, rather than being rejected immediately, points to max_execution_time rather than the size limit itself.
  • Check for a separate limit imposed by a plugin. Some form or gallery plugins enforce their own upload size cap independently of PHP's, in their own settings screen.

See fixing uploads that keep failing if the upload still does not go through once the size limit itself is confirmed high enough, since at that point something else in the chain is the more likely cause.

Why the limit exists at all

PHP's default upload limits are deliberately conservative, because a server accepting arbitrarily large uploads from anyone with a form on the site is a resource-exhaustion risk as much as a convenience question. Every upload consumes memory and disk space for the duration of the request, and a public-facing form with no cap at all is an easy way for a server to be overwhelmed, deliberately or otherwise. Raising the limit for your own account is entirely reasonable when you genuinely need it; the point is to raise it deliberately to a value that covers your actual files, rather than setting it arbitrarily high "to be safe."

A sensible limit for common file types

What you are uploadingReasonable upload_max_filesize
Standard web images (JPEG, PNG, WebP)The WordPress and PHP default is usually already sufficient
High-resolution photography, PDFs32M to 64M
Short video clips, large design files128M or higher, plus a correspondingly longer max_execution_time

Set the limit to comfortably cover the largest file you actually expect to upload, rather than leaving it at the default and hitting the wall every time, or raising it far beyond what anything on the site needs.

Related reading