Support » How-To and Troubleshooting » Detached image files?

Detached image files?

  • Hello,

    After a wordpress blog move, several of my photos was detached from posts using the Gallery function. They appear in the Media gallery but are not attached to a post anymore. Anyone know why this happened and what to do about it? I now have over 4000 pictures detached :((

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hello,

    How have you been attaching photos before the WordPress blog move?

    If you have been posting in the Media Library, the photos will not be attached to any posts. Only when you upload a medium in a post can you attach.

    The Gallery function only extracts, not really deletes. Maybe you have deleted an attribute from shortcode that may have cause a deletion.


    Thank you for your reply Lauren!
    OK, I see what you mean. The problem I have is that after the move, all my posts that I used [gallery link="file"] doesn’t contain any photos anymore. However I find the photos in the media gallery but they don’t appear in the posts anymore.

    Maybe, when you moved, you may have changed the domain.

    Yes I did, but what went wrong you mean?

    Is there anything in the SQL I can change in order to make the galleries work?

    In SQL, you may have to update the links for 4, 000 images. But, there should be a PHP code to loop the images from the Media Library.

    Try these links:



      $audios =& get_children( ‘post_type=attachment&post_mime_type=audio/mpeg’ );
      foreach ( (array) $audios as $attachment_id => $attachment ) { ?>

    • <?php echo wp_get_attachment_link( $attachment_id ); ?>
    • <?php } ?>

    Thanks! Ill try that!

    Did this work for you? I think I may have the same problem – http://t.co/DJxcDNFNRZ



    Forum Moderator

    Why are you using an old copy of WordPress? Were you aware that your site is currently running a very real risk of being hacked. You need to upgrade WordPress asap.

    If you are not using WordPress 3.4.2, then please post a new topic.

    @esmi – Thanks, I know. The old site was 3.4.2. That’s the CLIENT’s old site – the one we’re moving INTO our Multisite install which is up to date. They didn’t have anyone maintaining their site for awhile which is why it’s out of date – same with their theme – they hadn’t changed out their theme back when WP rolled in featured images, custom menus, etc… big updates. So now we’re dealing with an upgrade from their site to our install, their theme to ours, from their single site to our multisite. Everything is fine except for this image issue.

    I posted it as 3.4.2 because this site started as a single site that WAS 3.4.2 before we ported it into ours and I thought that might be important. I guess now that it’s on ours you can go ahead and change it to 3.5.1.

    @esmi – I know you were talking to the original poster – I had my thread open, too. I thought you were posting there! 😉



    Forum Moderator

    This is a 5 month old topic. You’d be better off posting a new one explaining what you are currently trying to do. As you seem to be importing content in a multisite, the Multisite forum might be the best place to ask about this as multisites can be quite different from standalone installs.

    @esmi – I’ve got a thread already in the How to/Troubleshooting. If I post one in MS, too, will it get deleted?



    Forum Moderator

    I can’t see any recent topics of yours in that forum, so just go ahead and post in Multisite.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Detached image files?’ is closed to new replies.