Inline images don't show as attached in media library

  • I noticed that some icons I inserted as inline images at the start of a paragraph (via more rich text controls) appear as unattached images in the media library. (The site I am working on is not yet launched, might that be the reason?)
    Since I know they are in use it’s not a problem, but just to understand why they don’t show I’d like to know how the media library gets the information about the use of images.
    If somebody would want to clean up the library and delete all unattached images that might cause some unpleasant surprises.
    Would it be wise not to use inline images at all?

  • Hi there,

    Images used in posts don’t always get attached to them. As far as I know that only happens when the image is uploaded via an image block (or the Add Media button in the classic editor), from within the editor itself. Images added to a post via a gallery, or uploaded to the library first and then inserted, often don’t get attached.

    This is just how the WordPress software has worked for as long as I’ve been using it, and I don’t know of any way to prevent it.

    If somebody would want to clean up the library and delete all unattached images that might cause some unpleasant surprises.

    That certainly would. But it’s important to keep in mind that unattached doesn’t mean unused – the media library nowhere gives any indication whether or not an image is actually used.

    Besides being used in posts, unattached images can also be in use as the site icon, a custom header or background, or as featured image on a post or page. And if an image is in use on multiple posts, it would only show as attached to the post where it was originally uploaded.

    So I would never delete any image in my media library based on it showing as unattached.

  • “I’ve just cleaned up my Media Library and now some images are missing” is probably the biggest cause for dismay that I’ve seen over the years.

    As @kokkieh mentioned, unattached doesn’t mean unused.

    From my own experience after I finish writing a post, I head to WP Admin’s Media Library and attach anything that didn’t get attached during the process. I also set up a Privately published page to attach any loose images like icons, headers and the like just to be on the safe side. I’m a bit of a stickler that way.

  • Thank you @kokkieh and @justjennifer
    I am new to wordpress, and it’s good to know that one can’t rely on the attachment status in the gallery. I thought the library might just “read” any img links.

    Using a private post to organize the loose images is an idea I might steal from you, thank you :)

  • The topic ‘Inline images don't show as attached in media library’ is closed to new replies.