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.
The featured image itself– the actual
.jpg
, or.png
, most likely– is saved towp-content/uploads
with primary image data saved to$wpdb->posts
as anattachment
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 apost_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.
The featured image ID is stored in wp_postmeta with a meta_key called _thumbnail_id. Example:
The actual thumbnail link is then contained in wp_posts with a post_type of attachment. Example: