Set Thumbnails via Database
-
So I have a ton of old posts that have images attached (via the Media Uploader) to the post content, but don’t have featured images. OF COURSE, my theme wants to use featured images. 🙂
I have the post_id of each post in my set. I have both the meta_id value of the image for each post and the URL of each image.
I want to just do a SQL statement/insert/update in my database backend to set all the featured images, but I can’t seem to get it to work. I tried inserting the post_id, meta_key=”_thumbnail_id”, and meta_value=my image ID into the _postmeta table and … nothing. They don’t show up as attached on the front-end. Am I missing a step? Do I need to regenerate thumbnails or something afterward?
Any insight is greatly appreciated, thanks!
P.S. I know there have been solutions/ideas posted elsewhere about how to accomplish this with php or wp hooks, etc. I just want to update from the database side if possible…SO much less confusing for me. 🙂
The topic ‘Set Thumbnails via Database’ is closed to new replies.