Try this
function filter_image_sizes() {
foreach ( get_intermediate_image_sizes() as $size ) {
if (in_array( $size, array('medium', 'medium_large', 'large') ) ) {
remove_image_size( $size );
}
}
}
add_action('init', 'filter_image_sizes');
Related Posts:
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Filter to remove image dimension attributes?
- Is there a hook which fires after all thumbnails are generated?
- Change WordPress image URLs via filter
- get_the_post_thumbnail_url with an unregistered size
- Cropped featured image replaces original image in gallery
- Remove title attribute from images
- No srcset for hard-cropped thumbnails
- Removing Title Tag from Thumbnails
- Lazyload post thumbnails
- How to stop thumbnail generation from some images and different size thumbnail generate
- Update old Post image metadata to ‘thumbnail’ wp_attached_file
- How to stop wordpress always displaying full-res images
- Fixing image names for a site being restored
- Can we use featured image as third party website image URL
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- add_image_size not working
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- adding image to post thumbnail from another server
- How to add thumbnails to posts and pages automatically in a uniformed fixed elegant way?
- How to change Gallery image url in product page ? In function.php?
- How to use default image as featured image by implement some code in function.php
- WordPress Multisite: Images moved to /sites/1?
- I cannot upload images to post or the media library in wordpress
- Why image Thumbnail url is not displaying with custom size?
- Making a thumbnail if there exist a link with. jpg or .png extension in WordPress
- WP is showing wrong image dimensions
- I tried to move the featured image below the paragraphs but now it is displaying twice
- Programmatically get images by URL and save in uploads folder
- the_post_thumbnail responsive srcset not populating with custom image size
- How to change image type for specific size?
- is it possible to replace the use of gd_lib with imagick or ImageMagick?
- Insert an image into a post by API
- hook into completed image upload filter
- Filter Media Library by author or post_parent
- set_post_thumbnail_size not cropping featured images, but reducing proportionally
- How to grab first image attached to post and display in RSS feed?
- Double thumbnails?
- How to display a shortcode caption somewhere other than the_content
- Displaying a featured image (only img url) as the img src?
- When displaying the featured image, is has_post_thumbnail() necessary?
- WP 3.4 has missing photo data
- Image Quality Thumbnail Compression in WordPress?
- What’s the proper way to use the get_image_tag filter?
- Add instructions to featured image
- How do I get more image editing options in the admin?
- How check that there is post thumbnail feature image or not on wordpress?
- Set Post Image Using Shortcode
- Print specific image size in galley loop
- Store Snapshot created via wordpress to use with lightbox
- How can I add a “data-pin-nopin” the featured image html?
- how to link post-thumbnail to original img in a lightbox?
- Add padding while generating thumbnail
- Can’t generate thumbnail images
- How to make thumbnails of uploaded animated gifs NOT animated
- “Medium” size image displayed instead of “thumbnail” in only one post, other posts are fine
- Custom Loop, Match Category with Page: How to display post featured image?
- How to fit image to Thumbnail canvas size?
- Redirect to another page using contact form 7? [closed]
- Generate images to be associated for tag and category?
- Bulk-add featured images in posts with no featured image
- Why doesn’t WordPress use the smaller sized image?
- Get an image from url, resize it, and save on a custom folder (not the media library)
- Else/If Statement to Display Photo Descriptions
- Remove Additional image sizes created by theme
- Dynamically determine the width and height of a image file to be cropped & uploaded AFTER form submission given fixed aspect ratio
- Disable Media File Image Link On Mobile Devices
- Set two default featured images
- Prevent WP from wrapping html in caption shortcode after ‘image_send_editor’ filter is applied
- Placing a featured image into header
- How to only show div of caption if caption exists on featured image
- Display Multiple Photos as Featured Image when mouse moves on to it post
- How to echo images Urls from a wordpress post, that are relally in the post
- WordPress Responsive Image ( srcset ) not work properly
- How to Display Image Caption but Not Alt Text
- Image alt attribute
- How to set a post featured image from an already made custom field
- Why does wp_get_attachment_image_src return the wrong size, when the correct size exists?
- New portfolio items appearing smaller on the grid
- WordPress can’t detect any thumbnails size?
- stop wordpress from resizing feature gif images
- second featured post not displaying on page [closed]
- Does WordPress have a way of changing the ‘Natural’ size of uploaded images?
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- set_post_thumbnail_size only working for width
- Newly uploaded images are not updating in featured image
- How to attach post ID to image links in WordPress tinymce editor
- Troubles with code for upload a image
- Image thumbnail on single product issue | WooCommerce
- Create a custom attachment thumbnail for quick page load
- get the post thumbnail returns the full size
- Why are my ‘medium’ images the wrong size
- Removing image dimensions from `the_content`
- Create post thumbnails from images stored outside of uploads directory
- Using the on-board image editor for featured images: edits are not being used
- has_post_thumbnail() Returns False on Scheduled Posts
- Delete all thumbnails & regenerate them?
- How to add a link to media file for every image inserted in content?
- WordPress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)
- Edit multiple posts featured image