Revision featured image

In WP revision i can not see if i upload featured image and update post. WP revision save just content, heading and excerpt. I have problem with some employs, they said that uploaded image and we do not have that in Database. How can i see in revision or in database if someone upload image on post and update post?

Topic revisions post-thumbnails plugins Wordpress

Category Web


The featured image is saved as postmeta, and by default, postmeta is not stored in revisions. This means that if anyone removes the featured image and saves (updates) their post, that postmeta is removed and not associated to the post anywhere.

If you need to modify this behavior for the future, you can programmatically enable saving postmeta to revisions, though since it's not Core behavior it requires a fair bit of logic.

However, you may be facing some user confusion: is it possible for your users to insert an image within the post content? That is something you can check in the database - as long as you're not using a page builder plugin or anything that saves main content somewhere besides post_content. You can check each revision's post_content column in the database and see whether any images are there within the content. If so, you could make note of which image the user used, then go into the actual Editor and assign that same image as the featured image for their post.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.