This is a problematic idea. WordPress do not have any strong connectivity between an image (or any other uploaded file) and any content (post). This means that in theory you can not make a decisions like if it is an image on page do X
as nothing ensures you that the image will not be used somewhere else as well.
This is a wordpress design decision, and frankly, as much as I personally dislike it, there is no point in fighting it as you will have to constantly fight the side effect of it (image regeneration for example) and except for cluttering the upload directories it does not do much damage. The only real solution is wordpress switching to image generation on the fly which is unlikely to happen any time soon.
Related Posts:
- Creating an Image-Centric Custom Post Type?
- List most recent image uploads, but only for specific custom post type
- Add custom field to media attachment image attribute in post editor
- Count all images of a certain post type
- How to get source of custom meta image?
- Return Attachments from Custom Post Type
- Issue to get wp_get_attachment_image with cmb2
- List all images from a single post meta value
- Get image post ID in media upload
- How can I get the number of custom post type posts that have a specific attachment image set?
- Hierarchy and access control for Custom Post Types (CPT)
- frontend image post uploader
- How do you get the full size url of an attachment image
- Add post meta programmatically to attachment
- How do you output an unknown number of images in a custom post type with desired markup?
- copy images from custom field to another custom field
- Let users upload image(s) to the post from front end
- Should i use custom post type for a custom footer?
- Dupplication of Custom Post Type while adding attachment
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Delete custom post type metadata without deleting the post in admin area
- How to Create a Frontend Html-list Editable in the Backend?
- Allow authors to create article image
- How to Add Custom Fields to a Custom Post Type?
- Do_Shortcode not working for Embed
- Display custom post type and custom fields within a Bootstrap Carousel
- how to filter by last name for custom post
- Search that will look in custom field, post title and post content
- clients list using wordpress
- Custom Taxonomy Template Post List with Sort Order
- Display Custom Post Type Fields
- How to do a custom bookmarks post type?
- How do I add media to a custom post type?
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- How do you modify the ‘post_parent’ of a custom post type?
- add_meta_box: Datepicker like the one for postdate?
- Custom search with Custom Fields in WP REST API?
- Adding a Gutenberg-like custom field on a custom post type
- Automatically populate a hierarchical taxonomy from a custom field
- WordPress posts with multiple fields
- How to dynamically attach pictures to a carousel
- How to add a Custom Meta Box for more than one Post Type?
- WordPress custom loop filter by meta_key and value with serialize data
- How to move image thumbnails into custom folder for custom post type
- Give a permalink to Custom Post Types without title
- How do I create custom fields for multiple post types?
- Why can’t my admin account manage attachments on a custom post type with a unique capability type?
- Cannot add custom field to “orderby” parameter in Rest API
- How to automatically set ‘default image size’ for specific Custom Post Type
- Custom Meta Field – Remove comma from string with str_replace
- Tracking changes in admin-page so user gets warning when leaving the page
- How to Create a WordPress Plugin With Custom Post Type/Custom Field Features?
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- First custom field value (out of several) displayed twice after query
- Multiple Frontend Filters Using Advanced Custom Fields
- create custom meta box with default value
- Add custom attributes to a post
- Custom Taxonomy Search result page
- Get post content from another section in custom single page
- Modify Posts from Custom_Post_Type within the plugin
- How to convert custom fields to content
- Increasing the default number of posts in custom post types
- Group by custom field value (start and end times)
- Variable Products as custom post types
- How to call a post’s metadata in shortcode.php?
- updating one custom meta field only
- Confusion about how to use Custom Post Types, Custom Taxonomy or Category?
- Displaying Posts Using a Custom Query with a Custom Field and a term_id
- Create list from custom field comma separated values
- Get previous and next custom post by custom field
- Having a repeating custom field in admin custom post type, what I’d go better with, for DB’s sake? ACF repeater or query a different post type?
- Create an user checklist system for a course plateform using ACF Pro and ACF Extended
- How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- WP_Query get always custom post_type for first
- Post Click Redirect to Custom URL instead of Single Post Page
- wp_insert_post deleting previous post custom meta
- Show posts from WP Custom Post Type selected from a field in a metabox
- meta query multiple values for the same key
- Custom post types – meta_query: search lesson which starts sooner
- Custom Field to post_title
- Automatically convert standard posts with custom fields to custom post types
- Importing URLs of Audio Enclosures
- Retrieving custom post type fields without a post
- Get month and day from a Date Picker custom field
- custom fields not showing before get_header
- Working with gallery shortcode and get gallery images
- pre_get_posts with multiple post types AND a meta_key
- Search form to find custom meta box generated data
- Display Custom Post if custom field is marked
- predefined custom field on registration page
- Show Custom Post Type taxonomy term that matches custom field
- Select Menu for Custom post Type does not save
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Display ACF object field data using Elementor Custom Query
- Sortable admin columns ordering from custom fields isn’t combine com search and Dropdown filter
- WordPress custom field sorting, weird behavior: the latest post is at the end
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes
- How to consume external API from WordPress post editor and display the response data in the custom field?