1 Answer. Like almost all content in WordPress, a Media item (aka attachment) is stored in the wp_posts table, and its metadata is stored in the wp_postmeta table. ... If the Media item is set as an attachment to a specific post, then inside the wp_posts table its parent is set to the Post ID of the actual Post.