WordPress normally stores uploaded images as files under wp-content/uploads/ and tracks each Media Library item with an attachment record in its database. The file holds the pixels. The record stores information such as the image’s title, caption, alt text, and file location. If an image is missing, check the Media Library entry and open its file URL directly. A record can survive after the file is gone, and a file can sit on the server without appearing in the library.
What WordPress saves when you upload an image
On a standard single-site installation, an image might live at wp-content/uploads/2025/03/field-notes.jpg. The year and month are upload folders, not the date the photo was taken. Check Settings → Media for the option to organize uploads into month- and year-based folders. Changing that option does not move existing files. Multisite, custom upload paths, and media offloading can change where files live or which URL serves them, so use the attachment’s actual URL rather than assuming the default path.
WordPress can also create smaller files, such as field-notes-300x200.jpg. Which sizes exist depends on the source dimensions, image processing, and the sizes registered when the image was uploaded. A large upload may have a -scaled version that WordPress uses as the full-size display file while retaining the original upload separately. A filename suffix is a clue, not a complete inventory.
What the attachment record does
WordPress stores the attachment in the posts table, typically wp_posts, with the post type attachment. The title, caption, and description are fields on that record. The post meta table, typically wp_postmeta, holds additional details: _wp_attached_file normally stores the file path relative to the uploads directory, _wp_attachment_metadata records dimensions and generated sizes, and _wp_attachment_image_alt stores the library’s alt text when set. Your database prefix may differ. You don’t need to open the database to make any of the checks below.
A page can reference an image by attachment ID, by URL, or by both. A featured image is linked by attachment ID, while an Image block can save a URL and its own alt text in the page content. That’s why editing alt text in the library may not update an image already placed on a page. Edit that instance in the page editor and verify the published result.
Trace one image from the Media Library to the page
Pick one problem image and follow it all the way through before changing anything. If it breaks only on a phone, check it at a narrow viewport as well. The browser can select a different file for a different screen.

- Find the library item. Go to Media → Library and select the image. In grid view, look for File URL in Attachment Details and copy it. In list view, open the item’s edit screen if you don’t see the URL immediately. If several items look alike, compare their filenames and upload paths rather than relying on the titles.
- Open the library URL directly. Paste it into a private browser window. A visible image confirms that this URL serves a file to a logged-out visitor; it doesn’t confirm that the page requests the same file. If the URL fails, note whether it returns a not-found error, a forbidden error, or a redirect to another host.
- Find the request the page actually makes. Open the published page, then open your browser’s developer tools and select Network. Filter for images and reload. Scroll to the problem image if it loads only when it comes into view. Check the request URL and status. If you can’t identify the request, inspect the image element and look at its
srcandsrcsetattributes; the Network panel shows which candidate the browser actually fetched. - Compare the two URLs. Look at the hostname, upload folder, and filename. The page might request a resized copy, use an old domain, or go through a CDN. Don’t hunt for a CDN transformation URL as though it were a literal filename on your server.
Once you have the failing URL, check the corresponding location in your host’s file manager or over SFTP without moving or editing anything. If media is offloaded, check the configured storage instead; local copies may be intentionally absent. The Media Library is a catalog, not a proof-of-delivery receipt.
Fix the problem your checks actually found
The library item exists, but its file URL fails
For a 404, check whether the file is present at the expected location, including the exact capitalization. If it’s missing, restore that file from a known-good backup to the same path, keeping the existing attachment record. Check the destination before copying so you don’t overwrite an unrelated file. If the file exists but the URL returns 403, check the host’s access rules, permissions, or storage policy with your provider. Don’t make the directory broadly writable as a diagnostic shortcut.
The library URL works, but the page requests a broken copy
If the failing URL is a missing generated size, first look for that exact copy in the backup. Otherwise, try a thumbnail regeneration tool on staging or on a single attachment after backing up. Regeneration uses currently registered sizes and might not recreate a size from an old theme or plugin. If it doesn’t, reselect the image or an available size in the page editor. If the request points to an old domain, correct the reference where it’s stored, then clear the relevant page or CDN cache and retest. A cache purge won’t rewrite yesterday’s URL.
The file exists, but there is no Media Library entry
First check that filters or a filename mismatch aren’t hiding the item. If the file was copied into uploads over SFTP, WordPress does not automatically create an attachment for it. For one image, upload a local copy through Media → Add New Media File, then reselect it wherever you need the new item. This creates a new attachment ID and may produce a different URL; it doesn’t reconnect existing references automatically. For a large missing set, check the database backup before importing duplicates. The old records may be recoverable along with their original IDs and metadata.
Verify the repair and keep both sides backed up
Reopen the published page while logged out and check the image at both wide and narrow viewport sizes. Confirm that the browser loads the intended file, that the editor shows the right Media Library item where applicable, and that the published image has the intended alt text. If you repaired a featured image, check a listing or archive page that displays it too: that template may request a different size.
For future restores, keep the uploads files and the WordPress database from the same backup point when possible. If you offload media, make sure the offloaded files are covered as well. Restoring a single missing file is often enough when its attachment record still exists. Restoring an entire database just to recover one record risks rolling back unrelated changes; inspect the backup on staging before considering that route.