Trace a Stale WordPress Thumbnail to Its Attachment and Size
When the Media Library shows the updated original but a card still displays an older crop, follow the actual image selected by the browser before regenerating anything.
Identify the content and file actually in use
Open a staging copy of the affected page and record the image element, currentSrc and candidate sizes in srcset. In the editor, determine the attachment ID and the chosen size. A content block can contain a fixed image URL, while a theme template may request a registered size dynamically.
Compare the original and derivative
For the known attachment, review the registered sizes and generated attachment metadata with the developer or host. A developer can use wp_get_attachment_image_src to examine the URL WordPress returns for a specific size. Compare it with the requested URL and the displayed image. If the URLs differ, inspect the block or cache layer first.
Rehearse a narrow repair
Keep a copy of the staging original and derivatives. If the right attachment is missing the target derivative, test WP-CLI media regenerate for that attachment and intended image size. Check the command's handling of previous thumbnails before running it because existing pages may link directly to older files. Compare the result at narrow and wide widths.
Expected result
The affected page selects the intended derivative and other pages using the attachment still work. Log the attachment ID, size and exact URL before scheduling a production repair.
Related guides
- How to Check Responsive WordPress Images After a Restore
- Update Image Alt Text in Existing WordPress Blocks
Official references
Ferkesh Hosting. Last reviewed .
شكرًا على ملاحظاتك!