Which database table does “Featured images” save under?

I’m having an issue while upgrading WP from 3.2.1 to 3.5.2, where one section’s Featured images have all been deleted. When I visit that section’s edit post pages, the featured image thumbnails that were once there are no longer there. Is this a database issue? I just dumped/restored my database an hour ago. I’m wondering if the WP database upgrade deleted my data.

Which table do the featured images data go under? I’m wondering if I could just dump/restore that table again, but I don’t know which one it is. My images are still there, but the links to them don’t seem to exist in the database.

2 Answers
2

The featured image itself– the actual .jpg, or .png, most likely– is saved to wp-content/uploads with primary image data saved to $wpdb->posts as an attachment post type. Additional relevant data for the image is saved in $wpdb->postmeta.

What makes an image “featured” or not is an entry in $wpdb->postmeta under the key _thumbnail_id and a post_id field matching the post ID of the post for which the image is a “feature”– aka thumbnail.

It is hard to say where things have gone wrong. It could be any three of those components.

Leave a Comment