Attach unattached images in WordPress automatically after migration

Most of the time, after every WP migration, specially if you’re migrating from to a self-hosted WordPress blog, your images inside your media library will automatically become unattached. You can fix this manually by editing each and every image in your media library and attaching it to the specific post where it was attached before migration.

But is there a faster and quicker way to attach all unattached files automatically? Of course there is. I’ve been searching for it since I’ve migrated one of my friend’s site to a self-hosted WP blog from and I found this very useful thread in the WP support forums.

Anyway, to make this post short, there’s a nifty plugin that was shared by oomskaap. I downloaded and tested the plugin and it actually works. If you also want to automatically attach unattached images in your WP blog, just download this plugin. (I uploaded it in my blog in case the plugin that was uploaded in disappears.)

And oh, you can fork it in Github if you want.

Do you love this article and you want to receive more interesting posts from Bryan Veloso? Why not subscribe to this blog via e-mail? It's easy! Just enter your e-mail address below and confirm your subscription by clicking the activation link that will be sent to your e-mail! Get your free subscription now!

Enter your email address:

This entry was posted in Geekery and tagged . Bookmark the permalink.

One Response to Attach unattached images in WordPress automatically after migration

  1. Randal says:

    This is excellent bu has 1 flaw. It does not attach the featured image to the post. It attaches all unattached images present on the content, since the featured image is not present (my theme displays it on top automatically) it gets ignored and therefore unattached. Nevertheless pretty good plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *