0

I was told this : "Basically here Attach/Detach refers to the registration of the media file to the particular post while uploading to the Media Library and not whether it is used in the post or not."

However, I inserted an unattached image into a post and it becomes attached even if I didn't upload it to that post or page. So, it seems that its not just for media uploaded to...

I have many images which show their status as unattached in the media library, but they are either featured images in posts or pages or images in the postal page.

(More digging: In the database, wp_postmeta, it looks like the _thumbnail_id keeps track of the thumbnail for the post. post_parent is where the ‘uploaded to’ field is kept. Even though in wp_posts, post_parent field for the image is 0. my posts are finding their images fine. Looks like the other images associated with a post are in the post_content field.)

Should I manually attach them or does this matter to WordPress, integrity or functioning ? Basically, is this field just informational?

thanks!

( Note: I'm new to this forum and cannot comment, since you need 50 reputation points...)

  • Perhaps you could read How to Ask and the linked pages too. – Andy Macaulay-Brook Sep 27 '16 at 16:30
  • I was the guy that replied to the other thread, my point was the main thing in that table is the column header which says "Uploaded to" – bravokeyl Sep 27 '16 at 16:45
  • Generally, those unattached media files are not an issue. – bravokeyl Sep 27 '16 at 16:52
1

There are no real runtime or developmental issues you can run into when having unattached media. The Media Library is a place for you to keep any past or future media ( whether it be images, pdfs, docs, etc. ). You don't need to go through and ensure that every media is attached to any one post; as you said WordPress will do this whenever the media is in use.

A potential issue with unattached media is they can become "lost" in the sense that the user doesn't know it's not being used and it's just indefinitely taking up space on the server for no particular reason. This is troublesome on site with many posts or sites that have limited server space. I'm sure there are plugins out there that handle this type of issue but none come to mind.

The main point of the database fields for attachments is so that website that utilize the Attachment Page can show that information. A single media item can be assigned or used on multiple pages but it will still only assign one post_parent of whatever the original post is on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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