Make WordPress Core

Opened 6 weeks ago

#48194 new defect (bug)

Unregistered image sizes used for IMG tag "srcset"

Reported by: galbaras Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:
PR Number:


Following design changes, previously-generated thumbnails remain on the site, along with matching post meta entries linked to the respective attachment. WordPress then uses those to produce IMG tags.

In fact, these thumbnails are referenced even when the files don't exist on the site anymore, following a cleanup.

I think WordPress should only use thumbnail URLs for registered image sizes.

For bonus points, there can be a way to remove unregistered size references from attachment meta, perhaps in a Media > Audit admin page, which lets the user decide what to remove and what to keep.

For context, I've just cleaned images on a site and found a lot of legacy references to thumbnails of previously registered sizes in IMG tags. Media management and cleanup plugins I used could only detect the redundant meta data when I re-registered the old sizes temporarily.

Change History (0)

Note: See TracTickets for help on using tickets.