Support » Fixing WordPress » Where in Database is the featured images???

  • I would like to add Featured Image(s) to all of my posts but there are hundreds of posts so would rather export the table the featured images are in, add the data, then import replacing the old table.

    I have looked everywhere in the database, looked through the codex, and searched the forum but have come up empty.

    I read one thread where it said they are in the
    wp_postmeta table
    meta_key _wp_attached_file

    However I can not find any
    meta_key _wp_attached_file

    Was wondering if someone could direct me to where the data for featured image is stored???


Viewing 5 replies - 1 through 5 (of 5 total)
  • Well you aren’t going to see the key if there are no attached images stored.

    hmmmmm, I set the featured image on 4 of the posts just so that I do have featured images attached to posts and in the DB wherever that may be??

    well I have finally tracked down where they are.

    They are in the wp_postmeta table

    meta_id post_id meta_key meta_value
    874 3767 _thumbnail_id 3841

    with the meta value being the ID of the image
    unfortunately there are rows and rows of other data such as:
    meta_id post_id meta_key meta_value
    860 3766 _encloseme 1
    861 3766 _pingme 1

    just wondering if its ok to add rows as above to the table without messing things up??

    I really hope someone can help me through this. I would imagine it would be valuable in helping others add feature images in bulk.

    sorry lost the formatting on the examples
    meta_id post_id meta_key meta_value
    874 3767 _thumbnail _id 3841

    so I have managed to import a few featured images into the wp_post_meta table. They show up in edit mode of the post and I have added a tag and the same tag into the body text of the post.

    However they do not show up in the search results.
    I added a few search images on other posts (exact same image and tag) by adding one at a time in add featured image within the post edit and they do show up.

    I,ve looked at the database table and see no difference at all between the images I added through SQL and the images added manually through the post edit.

    There must be another table affected by adding the FI manually through the post edit???? any suggestions would really be appreciated

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Where in Database is the featured images???’ is closed to new replies.