Re-Attach a File to a Post or Page (File Attachment Management)

When a file is uploaded using the Add Media button from post edit screen, that file automatically becomes an attachment of that particular post.

When you delete the post, the media that are attached to it will be unattached. You can re-attach these media files to a post or page.

Place this in your theme’s functions.php file or your functions.php plugin.

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!