I think you might be jumping the gun with actively discarding the data here. What if next month trolls go away, you change your mind, and want all those featured images back?
I would just suppress them on front end by editing template and making thumbnail output conditional or filtering API with something like this:
if ( ! is_admin() ) {
add_filter( 'get_post_metadata', function ( $null, $post_id, $meta_key ) {
if ( '_thumbnail_id' === $meta_key ) { // add check for date or whatever
return false;
}
return $null;
}, 10, 3 );
}
This way you retain all the existing data, just prevent featured images from showing. If you change your mind just remove the check and everything is back.
Related Posts:
- show first 3 thumbnails of posts in different sizes [closed]
- Missing feature image link function
- How do I change/modify the_post_thumbnail(); html output?
- Automatically set the featured image
- Get recent posts with thumbnail
- How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
- Add options to featured image
- Linking thumbnail to full size image
- Generating Responsive Background Image Sizes in PHP
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Most elegant way to enqueue scripts in function.php with foreach loop
- Add a Post Thumbnail to an RSS Feed with custom size
- Automated mark posts as featured every day
- Make WordPress size and name images for Retina.js
- get excerpt without images
- Why are image thumbnails cropped proportionally (not per dimensions)?
- the_post_thumbnail fallback using hooks
- Display height and width properties with the_post_thumbnail() or related function
- Display 4 chronological posts starting with a random post
- Setting featured image with function, 1 part not working
- Removing the first image in content
- How to set the jpg image compression for specific thumbnail sizes?
- Function to auto-set a featured image that is already in use
- How to make thumbnail image fit into a div where image dimentions are completely different?
- When to use an if statement after get_posts?
- img width and height attributes being set by get_the_post_thumbnail
- Get the 5 lastest Featured Posts from a category
- How to Display Image Meta underneath EVERY image in EVERY post
- Update Content based on expiration time or queued processing
- How to display a default image for post thumbnail using functions.php?
- Change size and crop medium_large images
- Woocommerce Attributes pulling in wrong data
- Getting Featured Image Caption to Only Show if Populated
- wp_get_attachment_image function size argument not working if I also add a custom class
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Add Featured image column into wordpress admin on pages AND posts
- Post thumbnail not showing in WP admin area for custom post type
- Overwriting Parent Theme’s Image Sizes
- Set the background to a default image if there isn’t a specified “featured image”
- Backstretch.js and thumbnail sizes to reduce loading time
- set_post_thumbnail when user is not logged in
- Logged in user ID as post ID
- How to stop twenty fifteen theme from cropping featured images?
- Create a new query in function.php to filter blog posts
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- Set spesific size of featured images
- Can’t generate thumbnail images
- How can this crude function be improved?
- Redirect to another page using contact form 7? [closed]
- height should be set to auto to avoid pixelation in the post thumbnail function
- It does not work concatenation in function.php
- WordPress function, Run using Crontab
- How to retrieve the current post’s generated featured image size?
- Check if the image size is available and if not use ‘full’ image size
- Test if a post exists by category and date
- Turn get_posts as string into an array for use in theme admin options
- is there a way to remove featured image from blog page and single page
- How to hide image-url if no attachment?
- Can set_post_thumbnail be used to remove a thumbnail?
- Can’t locate custom image sizes defined by child theme
- Is it possible to use array_walk() to append terms to an array of posts?
- Else/If Statement to Display Photo Descriptions
- How to add a new image size and apply it to posts only?
- How to use get_posts() function in functions.php
- Fallback image URL if no featured image exists via a shortcode function
- Display a random tag but using cron to control frequency of change
- Show Featured Image in else statement
- Get the alt text of the image in a array
- If no author posts, echo out some text
- Change custom featured image size in twentythirteen child theme
- resizing of thumbnails not working
- Featured Image keeps cropping
- show all the posts thumbnails
- struggling with syntax for the_post_thumbnail();
- include w_thumbnail_src in function?
- Unzip file in functions.php, and add it to cron
- Custom image sizes showing in Classic Editor only when upladed directly to post
- Can/should we delete wordpress cron jobs with no action?
- Run function with schedule is not working correctly
- Bulk updating a group of WordPress Pages every 10 minutes
- Add Featured Image to Existing Post
- Which filter fires upon setting a featured image
- not outputting medium size image URL
- Wp_Schedule_Event every few minutes doesn’t work
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- How to put 2 php codes in functions.php without site crashing
- Image width issue in IE [closed]
- add if statement to the featured image
- image_size with respect to aspect ratios
- Remove default Image Sizes
- How to I add count of custom posts listed in a post as a prefix to its title
- Is mytheme_post_thumbnails() still necessary?
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- Generate and upload screenshot as featured image for user-submitted post
- Link on post title only if post have content
- Second featured image only shows in metabox preview after saving a post in the wordpress editor
- CPU Overloading due to some hooks
- Cron Register everytime if i reload admin if i pass some extra argument in wp_schedule_event function
- No src and sizes attributes present on WordPress thumbnail images; the smallest image size is loaded irregardless of viewport size
- add_image_size() parameter four ($crop = true) is ignored: the_post_thumbnail() returns scaled image(s) instead of hard cropped