Skip to content

WordPress Image Upload Limits Guide

Most advice tells you to edit php.ini. On shared hosting you often cannot. Compressing the image first works everywhere.

Compress the image below the limit instead of raising the limit, because a smaller file fixes the upload error and the page speed problem in one step. WordPress inherits its cap from PHP, usually 2 MB or 8 MB depending on the host, and on managed or shared hosting you frequently cannot change it.

Nearly every article on this subject tells you to edit php.ini, .htaccess or wp-config.php. Those instructions assume server access that most site owners do not have, and even where the access exists it is worth asking whether raising the ceiling is the right move.

Where the limit comes from

The cap is set by 3 PHP values, and the smallest of the 3 wins. WordPress displays the resulting figure under the upload box, which is why the number often differs from what a host advertises.

  • upload_max_filesize controls the largest single file PHP will accept.
  • post_max_size controls the total size of a submission, so it must exceed the file size.
  • memory_limit controls how much memory the resize operation can use while generating thumbnails.
  • max_execution_time can also cause failures, since a large image may time out before processing finishes.

The third value causes the most confusing failures. A file that uploads successfully can still fail while WordPress generates its thumbnail sizes, producing a broken image in the media library rather than an upload error.

Why compressing beats raising the limit

A 6 MB photograph on a web page is a problem regardless of whether the server accepts it. Raising the limit removes the error message and leaves the underlying weight in place.

WordPress generates several thumbnail sizes from every upload, so a heavy original multiplies into heavy derivatives and consumes storage across the whole media library. Compressing to a few hundred kilobytes before uploading fixes the error, reduces the generated sizes, cuts backup times and needs no server access at all.

How to get under the limit

To upload successfully without touching server settings, follow these 5 steps.

  1. Read the limit shown under the WordPress upload box, which reports the real figure for your host.
  2. Resize the image to its display width, doubled for high density screens, since a 4000 pixel photograph in a 800 pixel column wastes most of its data.
  3. Convert to WebP for photographs and graphics that will only ever appear on the site.
  4. Compress to a target of 200 KB to 400 KB, which suits almost every in article image.
  5. Upload, then check the image renders correctly at full width on both desktop and mobile.

Working in that order usually produces a file 90 percent smaller than the camera original, with no visible change on screen. The upload error disappears as a side effect rather than as the goal.

Recommended sizes for WordPress content

Match the image width to the widest space it will ever occupy in your theme, then double it for high density screens. Most content areas are far narrower than site owners assume.

Image useDisplay widthUpload widthTarget size
In article image700 px1400 px150 KB to 250 KB
Full width feature1200 px2400 px300 KB to 500 KB
Hero or header banner1920 px1920 px300 KB to 400 KB
Thumbnail or card400 px800 px50 KB to 100 KB
Author or profile photo150 px300 pxUnder 30 KB

When raising the limit is the right answer

Raise the limit when you upload genuinely large files that must stay large, such as print resolution photography, video or theme packages. Those cases are real and they are not the usual case.

A photographer delivering high resolution galleries, a shop importing a large plugin, or a site hosting downloadable PDF documents all need headroom. A blogger whose holiday photograph will display 700 pixels wide does not. Ask what the file is for before changing a server setting, because the answer usually points back to compression.

How to raise the limit if you must

Ask the host first, since most managed providers change the value on request in minutes. Support tickets solve this faster than configuration files on any hosting plan that restricts file access.

  • Managed WordPress hosts usually expose the setting in a control panel or adjust it on request.
  • cPanel hosting often includes a MultiPHP INI Editor where the 3 values can be set directly.
  • Virtual private servers allow editing php.ini, after which the PHP service must be restarted.
  • .htaccess edits work on some Apache setups and cause a server error on others, so keep a backup.
  • Plugins that claim to raise the limit cannot exceed what the server permits, whatever the description says.

The HTTP error that is not about size

A generic HTTP error during upload usually means memory or execution time ran out while WordPress generated thumbnails, not that the file was rejected for size. The distinction matters because compressing the image fixes both causes.

Large dimensions rather than large file size drive memory use, since the server has to hold every pixel in memory while resizing. A 6000 by 4000 pixel image needs far more memory than its file size suggests. Reducing dimensions before upload removes the failure even when the file was already under the size cap.

The thumbnail sizes WordPress creates

WordPress generates at least 4 additional copies of every upload, and themes and plugins commonly add several more. A single photograph can become 8 or 10 files on disk without the site owner ever seeing them.

The defaults are thumbnail at 150 pixels square, medium at 300 pixels, medium large at 768 pixels and large at 1024 pixels, alongside the scaled version WordPress creates for very large uploads. Page builders and gallery plugins register their own sizes on top. Uploading a smaller original means every derived file is smaller too, which is why compression before upload compounds across the whole library.

WebP support in WordPress

WordPress has accepted WebP uploads since version 5.8, and every current browser displays the format. Uploading WebP directly avoids the conversion plugins that many sites install for the same purpose.

Two cautions apply. Some older themes and page builders assume JPG or PNG and may not generate WebP thumbnails correctly, so check a test upload before converting a whole library. Images intended for download by visitors, such as press kits or printable guides, should stay JPG, since WebP remains awkward outside browsers.

Checking image weight on a live page

Open developer tools with F12, switch to the Network tab, filter by images and reload the page. The panel lists every image with its real transferred size, sorted largest first.

That view answers the question directly rather than by guesswork. Look for any single image over 500 KB and any page where images total more than 2 MB. The largest file is almost always the one worth fixing first, and it is usually a header image or the first photograph in a post. Fixing 2 or 3 images often removes most of the excess weight on a page.

Fixing a media library that is already heavy

Compress the existing library rather than only the new uploads, because old posts carry most of the weight on an established site. A blog running for 5 years may hold thousands of uncompressed images.

Download the uploads folder, process it as one batch, and replace the files keeping the same names so existing posts continue to work. Regenerating thumbnails afterwards rebuilds the derived sizes from the smaller originals. Take a backup before replacing anything, since this is one of the few image tasks that overwrites files in place.

Processing a whole uploads folder

Drop the folder in as a ZIP archive and every supported image inside is extracted, resized and compressed in one pass. Up to 500 files run per batch, which covers most small and medium sites in a few rounds.

Everything happens inside your browser on your own processor, so client sites, unpublished drafts and private galleries never reach a server. That matters for agencies working under contract, where uploading a client media library to an unknown compression service would breach the agreement even if nothing went wrong.

Back to blog