← All articles

Fix HTTP Errors When Uploading Media in WordPress

Troubleshoot WordPress media upload HTTP errors by checking server limits, Site Health, logs, and WordPress memory settings instead of assuming one cause.

By ShantanuUpdated 17 Apr 20212 min read
Illustration of a laptop, photo upload, and repair tools for a media upload error.

A generic HTTP error during a WordPress media upload does not point to one specific fault. It can be caused by PHP memory limits, upload-size limits, server security rules, image-processing failures, timeouts, or a plugin/hosting conflict.

Start by collecting enough information to identify which limit or component is actually failing.

1. Test with a smaller file

Try uploading a smaller image of a common type such as JPEG or PNG.

If a small file works but a larger one fails, check the site’s PHP upload and memory limits rather than repeatedly retrying the same file.

2. Check Site Health and server logs

In WordPress, open Tools > Site Health and review the server information and any reported problems.

Also check the hosting control panel or server error log around the time of the failed upload. A PHP memory error, timeout, request-size limit, or security-module block gives you a much more reliable fix than the generic browser message.

3. Increase WordPress memory only when memory is the problem

If the log shows that WordPress exhausted its PHP memory allocation, back up wp-config.php and add a higher WordPress memory limit before the line that says /* That's all, stop editing! Happy publishing. */ (wording varies by installation):

define( 'WP_MEMORY_LIMIT', '256M' );

256M is an example, not a universal requirement. WordPress cannot force PHP to exceed the memory limit imposed by the hosting environment. If the host has a lower server-level limit, ask the host to change it.

4. Check upload and post-size limits separately

WP_MEMORY_LIMIT is not the same as PHP’s upload_max_filesize or post_max_size. If the file exceeds the server’s upload limits, those PHP/hosting settings must be adjusted by the hosting configuration or provider.

5. Check recent plugin, security, CDN, or hosting changes

If uploads stopped immediately after a plugin, firewall, CDN, PHP-version, or hosting change, test that change in a staging environment or ask the provider to inspect the request. Do not disable production security controls blindly.

Official reference

WordPress Developer Handbook — wp-config.php and WP_MEMORY_LIMIT: https://developer.wordpress.org/advanced-administration/wordpress/wp-config/