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 can I dynamically add a post to a custom post type which uses a custom field?
- uploading images to specified directories
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Custom Posts Types as Custom Fields
- Why is my select meta data not saving?
- Link to full size post thumbnail
- Hide editor while keeping add media button in custom post type
- dynamically add a custom field or metabox to custom post type [duplicate]
- Give a permalink to Custom Post Types without title
- Role scoping for contributors down to the field level
- How to implement a Google map store locator
- Custom Post Type with image gallery
- Creating a Custom Post as a repository for theme constants
- Multiple featured sizes / images / excerpts
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- search also in taxonomy, tags and custom fields
- Random image from tag/custom type on sidebar
- How to stick custom post at the top in search results
- How to Create an Image Upload Box for Custom Posts?
- How do I create custom fields for multiple post types?
- Add field to all custom post types
- Query & Order posts by custom fields
- Filter custom posts using auto populated dropdown selectors
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- Why can’t my admin account manage attachments on a custom post type with a unique capability type?
- Custom post type content using custom fields without template
- Cannot add custom field to “orderby” parameter in Rest API
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- retrieve Meta field value from CPT and set those values as Image Meta Field “Title”
- Having unique constraints for custom fields in a custom post type
- Querying Two Custom Post Types with OR Not Working
- Trash / Draft a WordPress custom post after custom date field expires
- Set a maxlength for the title input in a custom post type
- Posting to a Custom Post Type from front end – user generated content
- Add custom image size for custom post type or taxonomy
- Display custom fields from custom posts in RSS feed
- Bulk Update Custom Fields for Custom Post Types
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- Visual editor issue by having multiple tiny mce editors in a CPT
- WordPress Custom Fields Won’t Save
- Update Post Meta for a logged in user
- Problem querying Custom post type by custom fields
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Add custom field to Posts and sort by it
- Orderby CPT custom fields not working
- WP_Query order by custom field, then randomly order some of results
- A better way to add a meta box to custom post types
- Rows with custom columns not well formatted after Quick Edit save
- How to automatically set ‘default image size’ for specific Custom Post Type
- Plugin – Combine Meta Box Input Fields into single saveble record
- Two Custom Post Types Many to Many Relationship
- Show custom post type relationships by taxonomy
- get_post_meta not working on publishing
- Query custom post type with ACF Date
- Custom setting to show or hide field
- Custom Meta Field – Remove comma from string with str_replace
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Using custom field content as expression in IF statement [closed]
- Meta Query Not Returning Output Despite Having Matching Values
- How to create a custom post type with additional fields?
- Callback to custom field is not working in WordPress REST API
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- Including metaboxes from custom post types in global search — continued
- ACF From & To Date Validations
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Query Multiple Custom Posts by Custom Fields
- Show image gallery from a custom field
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- Dynamic dropdown select values depending on other custom field value
- How to render a custom post type template with custom fields using shortcode
- Disable saving posts as draft (make all posts mandatory regardless of the post status)
- Grouping metadatas into one
- Tracking changes in admin-page so user gets warning when leaving the page
- filter custom post in rest api with custom function
- Get Posts by multiple custom fields is not working
- Woocommerce custom field search in custom post type [closed]
- Add custom field in comments form