Compress images for WordPress
That 2 MB ceiling comes from PHP, not WordPress, which is why the admin has no setting for it. The better question is whether you should raise it at all.
- Source
- PHP upload_max_filesize, 2 MB by default
- In-article
- 1600 px long edge, under 300 KB
- Hero banner
- 2560 px long edge, under 600 KB
Target size 2 MB
Drop images or videos here
Or click to browse, or just hit Ctrl + V to paste a screenshot
Images: JPEG / PNG / WebP / GIF / BMP · Videos: MP4 / MOV / WebM / AVI
Results
Before / after
WordPress did not set that limit
The "exceeds the maximum upload size for this site" message reports PHP’s upload_max_filesize, which defaults to 2 MB. Because it lives at the PHP layer, no amount of hunting through the WordPress admin will find it.
Two related settings block you at the same time: post_max_size (the whole POST request, which must exceed upload_max_filesize) and max_execution_time (large uploads time out). All three have to be right, which is why so many tutorials appear not to work.
Can you raise it
| Hosting | Usually possible? | How |
|---|---|---|
| Self-managed VPS | Yes | Edit php.ini, restart |
| Panel-based hosting | Mostly | PHP settings in the panel |
| Shared hosting | Often not | Open a ticket and ask |
The widely-copied .htaccess override does nothing when PHP runs as FastCGI or PHP-FPM, which is how most hosts run it today. If that trick failed for you, it is not your mistake.
The question worth asking instead
Being able to upload is not the same as should upload. An 8 MB original placed in an article is 8 MB that every single reader downloads. On mobile data, one image can cost several seconds.
| Use | Long edge | Target size |
|---|---|---|
| In-article image | 1600 px | Under 300 KB |
| Full-width hero | 2560 px | Under 600 KB |
| Thumbnail / avatar | 600 px | Under 80 KB |
WordPress generates several thumbnail sizes automatically, but all of them derive from the file you uploaded. Give it something oversized and every derivative is oversized too.
Use WebP
WordPress has accepted WebP uploads since 5.8, and every current browser renders it. At matched quality it is 25–30% smaller than JPEG, the cheapest page-speed improvement on the list. The format option here defaults to Auto, which picks WebP where the browser can encode it.
The only caveat is very old WordPress installs or plugins that do not recognise WebP; switch to JPEG in that case.
The workflow
- Pick the preset that matches the use above.
- Drop in up to 30 images at once and download them as a single ZIP.
- Unzip and upload straight to the media library.
Frequently asked questions
Why does WordPress say the file exceeds the maximum upload size?
That limit comes from PHP’s upload_max_filesize, which defaults to 2 MB. It is not a WordPress setting, which is why there is nowhere in the admin to change it, you have to change PHP configuration, and shared hosts often will not let you.
Can I raise it myself?
Depends on the host. Control panels like cPanel usually expose PHP settings directly; a VPS lets you edit php.ini; shared hosting is frequently locked. Rather than fight your host, compressing under 2 MB is usually faster and better for the site anyway.
If I raise the limit, is the problem solved?
Being able to upload is not the same as should upload. An 8 MB image in an article is 8 MB every reader downloads. Page speed is a real user-experience issue and a ranking factor. Compressing properly beats raising the cap.
How small should images be?
In-article images: 1600 px long edge, under 300 KB. Full-width heroes: 2560 px, under 600 KB. WordPress generates its own thumbnail sizes, but it generates them from what you upload, so the original still matters.
Can I use WebP?
Yes. WordPress has supported WebP uploads since 5.8 and every current browser displays it. It is 25–30% smaller than JPEG at matched quality, which is the cheapest page-speed win available. The default format here is Auto, which prefers WebP.