To unset all default image sizes in WordPress using PHP you can use this function:
add_filter( 'intermediate_image_sizes', 'remove_default_img_sizes', 10, 1);
function remove_default_img_sizes( $sizes ) {
$targets = ['thumbnail', 'medium', 'medium_large', 'large', '1536x1536', '2048x2048'];
foreach($sizes as $size_index=>$size) {
if(in_array($size, $targets)) {
unset($sizes[$size_index]);
}
}
return $sizes;
}
Alternatively, you can also unset default images by going into the WordPress dashboard. Then proceeding to Settings
-> Media
and put all value’s on 0. See image for reference:
Related Posts:
- How do I change/modify the_post_thumbnail(); html output?
- Set the background to a default image if there isn’t a specified “featured image”
- Else/If Statement to Display Photo Descriptions
- not outputting medium size image URL
- add if statement to the featured image
- Generate and upload screenshot as featured image for user-submitted post
- What’s the best way to use the Featured Image for responsive web design?
- How to add a class to the attachment images
- How to draw media details for Isotope gallery using Photoswipe
- How to register images uploaded via FTP in media library?
- Adding Featured Image to Post programatically
- Add custom image sizes to media uploader
- How to upload imagick resource to media in wordpress
- How do I get images (with a thumbnail preview) to show in search results?
- Using wp_get_image_editor in a standalone script
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Assign a picture URL to a page via PHP
- Change logo based on incoming domain
- How to scale image with equal width and height without distortion?
- How to Display Image Meta underneath EVERY image in EVERY post
- Convert all images to PNG on file upload
- Echo URL of large version of Featured Image
- How to get specific image in media library with php
- Recent posts with featured image or fallback image with permalink
- How to control WordPress image metadata (using Imagick)?
- Scrape external webpage for first image and add it to new post
- Redirect to another page using contact form 7? [closed]
- height should be set to auto to avoid pixelation in the post thumbnail function
- Three Questions with Twenty Eleven theme
- Resize image to specific dimension (X to Y ratio)
- Get featured image with custom size outside WordPress
- How to set a featured image (thumbnail) with PHP?
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- Fallback image URL if no featured image exists via a shortcode function
- Generate responsive post thumbnails of same size
- How to Make Thumbnail of Post Stay Animated
- Get the alt text of the image in a array
- Adding a ‘style=’ bit to image_send_to_editor output
- Convert all uploaded PNG files to PNG-8 format
- Retrieve alt text by referencing the img src
- Add Featured Image to Existing Post
- How to use data URL in WordPress?
- Replace background image with post thumbnail in shortcode
- Resize post thumbnail
- How to put 2 php codes in functions.php without site crashing
- How to link all featured images to custom url in single.php for only non-logged-in users?
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- Retrieving specific images from Media Library
- How do I routinely extract the thumbnail of the most recent post?
- insert thumbnail image from php script
- Can’t put a hyperlink on Featured Post’s Image
- add class to background image
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Save the outputted image into the Media Library, with a different filename and extension
- Overwriting a Shortcode
- Setting post thumbnail sizes in template file and functions.php
- Understanding responsive imagery
- WooCommerce: write featured image dimensions to custom fields in product’
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- wp_set_object_terms and arrays
- Admin Media grid view images won’t load
- WordPress remove EXIF Data from specific Thumb
- How to use WordPress (PHP) functions in AngularJS partials files?
- enqueue multiple Google fonts with multiple weights and styles (italic)
- Can’t load WP function into external function
- WSoD being caused by this piece of code
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- How to complete two other input fields, completed the first
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- jQuery code not working when included in functions.php
- Fatal Errors on pluggable.php
- Log in / Log Out Custom Button
- Fatal error: Call to undefined function register_new_user()
- How to modify the default feed via a function
- Automatically add images to a menu
- Loop over Array and get the distinct ids
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- How to add a new image size and apply it to posts only?
- Dynamic Menu drops pages?
- Aspx/Rss feed – failed to open stream: Redirection limit reached
- Adding an Unlinked Space in a Custom Function
- How do I call an external php non WordPress class into functions.php?
- send popup after wp_redirect()
- Checkbox doesn’t save inside metabox
- A function to get the content of a page
- How to get latest post ID in functions.php?
- Billing detail page doesn’t work after I’ve changed the order of the Woocommerce navigation
- How can I prevent a shortcode div from extending beyond its boundaries?
- Where Do Image Dimensions Get Added To A Filename?
- Advance custom fields variable with if statement & Function
- Printing OEmbed URL based on Post selected w/o page refresh
- Showing featured image of page’s child’s children page
- How to change this internal image link parameter using PHP?
- How to create “page” used for generating PDF? [closed]
- Why isn’t my custom function kicking in from my functions.php file?
- Shortcoding with Divs
- static array on functions.php
- Integrating CSS Into a WP Function Call [closed]
- How to limit the number of posts in the wordpress loop in conjunction with the “download more” button?