Sébastien Laframboise

Unable to upload an image to WordPress: useful checks

Unable to upload an image to WordPress: useful checks

Unable to upload an image to WordPress

When you can’t upload an image to WordPress, the image itself isn’t always to blame. The browser first sends the file to the server. Then PHP receives it and WordPress checks its format before adding it to the media library.

I therefore recommend starting from the error message shown and working in a logical order. Above all, avoid changing multiple settings at once. That way you can more easily identify the real cause.

Start with a simple test

First, try another JPG or PNG image with a simple name, for example product-photo.jpg. Also choose a file with reasonable dimensions. Temporarily avoid accents, special characters, and very long names.

Next, test directly in Media → Add. If the image works in the media library but not in a specific form or block, a plugin or the theme may be responsible.

WordPress also shows the maximum allowed size on the Add Media screen. If a small image works but a larger photo fails, that limit is an important clue.

Check the actual format of the image

An image can have a JPG extension without containing a valid JPEG file. WordPress verifies the file’s actual type and doesn’t rely solely on its name.

If only a few images cause problems, open them on your computer. Then export them again as JPG, PNG, or WebP with reliable software. This step can fix a badly encoded or incomplete file.

However, don’t arbitrarily allow rejected formats. File restrictions also help protect WordPress from unwanted files.

Check PHP limits and the file size

PHP must accept the file before WordPress can save it. Several settings can therefore block uploads, notably upload_max_filesize and post_max_size.

You can view several details in Tools → Site Health → Info. If you don’t manage the server, give your host the exact error message, the file size, and the observed limits.

Also, a very large image can require a lot of memory when creating thumbnails. In that case, reduce its dimensions and retest before increasing server resources.

Examine the uploads folder and permissions

WordPress normally stores media in wp-content/uploads. It must be able to write to this folder and create the necessary subfolders.

So check that disk space isn’t full and that the uploads folder exists. Also ensure PHP has the necessary rights to write there. However, don’t grant universal permissions just to bypass the error.

Isolate a plugin conflict

If the problem persists, a plugin may be interfering with uploads. Image optimization, security plugins, storage, or media management plugins deserve particular attention.

Disable only one plugin at a time, then run exactly the same test. This way you can identify a conflict without needlessly changing your entire setup.

What to do if the upload still fails?

If the message remains vague, check the PHP error logs or your host’s logs. Reproduce the issue, note the exact time, and look for an error related to memory, permissions, or the temporary folder.

When it is impossible to upload an image to WordPress, a methodical check will usually isolate the cause quickly. If you’d prefer to entrust me with the diagnosis or the fix, you can also consult my online store.