Last update at :2024-01-25,Edit by888u
WordPress does not turn off uploading the above image by default and will generate multiple versions of thumbnails. Regardless of whether you use it or not, the website Ftp usage will increase over time. It is recommended to disable the WordPress default thumbnail generation function.
1. Disablement method
Put the following code into the theme functions.php file to take effect
// Disable automatically generated image sizes function shapeSpace_disable_image_sizes($sizes) { unset($sizes['thumbnail']); // disable thumbnail size unset($sizes['medium']); // disable medium size unset($sizes['large']); // disable large size unset($sizes['medium_large']); // disable medium-large size unset($sizes['1536x1536']); // disable 2x medium-large size unset($sizes['2048x2048']); // disable 2x large size return $sizes; } add_action('intermediate_image_sizes_advanced', 'shapeSpace_disable_image_sizes'); //Disable scaling add_filter('big_image_size_threshold', '__return_false'); // Disable other image sizes function shapeSpace_disable_other_image_sizes() { remove_image_size('post-thumbnail'); // disable images added via set_post_thumbnail_size() remove_image_size('another-size'); // disable any other added image sizes } add_action('init', 'shapeSpace_disable_other_image_sizes');Recommended site searches: Korean virtual host cloud server rental, American imitation brand space, forum host, Korean independent server, registration and cancellation, domain name space, white prostitution permanent high-performance server, Hengchuang host, Hong Kong server hosting,
All copyrights belong to 888u unless special state
发表评论