WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently, there is no way to do this in a vanilla Wordpress install. Is there a way to retroactively attach an image from the Library to a post?

EDIT: Ah, let me clarify — when editing a post, and clicking the "Insert Media" button, I see no way to add past media. I can insert it into the post, but not add it to the post gallery.

share|improve this question
up vote 1 down vote accepted

This is not something that is currently supported in WordPress. There's some discussion about it here: http://core.trac.wordpress.org/ticket/6820

One plugin which does enable this functionality is:


This plugin does a few extra things, but one option it provides is that after clicking "upload/insert" and going to the media library tab, you can tick check boxes beside images and choose to attach them to the current post.

There's also an old thread on WordPress support forums which pertains to adding a small bit of code to your functions.php file to enable this functionality but I think that only works within the Media Library section, not when in the Upload/Insert thickbox, so the above plugin might be your best bet.


share|improve this answer
Here's the official repository link for the File Gallery plugin: wordpress.org/extend/plugins/file-gallery – alexleonard Jun 20 '12 at 16:19
Thank you so much! – tekknolagi Jun 20 '12 at 19:03
You're most welcome :) – alexleonard Jun 21 '12 at 13:09

There's a little glitch in Media panel, when attaching multiple files at once, do the following:

  • Access Media Library panel
  • Click the link Unattached
  • Now you see only unattached files then select the files you want attach
  • select Attach in Bulk Actions drop down and choose the page/post.

Right when accessing the panel, the Bulk Actions doen't shows the Attach option.

share|improve this answer
Please see my edit. – tekknolagi Jun 13 '12 at 23:03
Not a normal thing, Some plugin or theme is doing this, you better deactivate plugins and try the default theme. – Diana Jun 13 '12 at 23:08
I can assure you that nothing is interfering with the Media Library — I can even send some screenshots. – tekknolagi Jun 14 '12 at 1:53
I can insert them into the post, but not add them into the post gallery. – tekknolagi Jun 14 '12 at 1:56
Ah I see, there's no way to attach a file to multiple posts. The gallery shortcode only display the files within the post. You can use a plugin such portfolio slideshow and inform (plugin shortcode) which images display. The WOrdPress shortcode is fro attached files of current post only. – Diana Jun 14 '12 at 2:34

Not sure why you believe there's no way to attach an unattached item directly from the media library by default - in the list of media library items, You'll see a column for "Attached to". Items that are not attached to anything will say (Unattached) and then have a link to attach the item to a post.

share|improve this answer
Please see my edit. – tekknolagi Jun 13 '12 at 23:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.