December 14, 2019
Yikes, WordPress Has Gotten Worse
December 14, 2019
Several years ago, I did a lot of work with WordPress. It was no bed of roses then, but it was usable. You could design a nice site and then hand it off to less-skilled ( read: cheaper ) people to maintain, and that model worked very well for a business.
So when I wanted a little personal site, I figured I'd pick up WordPress again. It sure has changed, and not for the better. It has grown enormously, usually not a good sign. The programmers don't seem to be able to tell if their new features work right, or at all, let alone usefully, and they don't seem to care. They just keep piling on more and more crap, with each new brainstorm they abandon what came before in whatever state it is in, typically broken.
The new image handling in WordPress is an absolute horror. Here is a code snippet from my theme's functions.php that stops it cold:
//// prevent generation of "-scaled" images
add_filter( 'big_image_size_threshold', '__return_false' );
//// prevent generation of useless "thumbnails" except one
function simple_remove_default_images( $sizes ) {
unset( $sizes['small']); //// useless clutter
////unset( $sizes['medium']); //// keep for media library
unset( $sizes['large']); //// useless clutter
unset( $sizes['medium_large']); //// useless clutter
unset( $sizes['1536x1536']); //// twentysixteen garbage?
unset( $sizes['2048x2048']); //// twentysixteen garbage?
unset( $sizes['post-thumbnail']); //// useless clutter
return $sizes;
}
add_filter( 'intermediate_image_sizes_advanced', 'simple_remove_default_images' );
add_filter( 'intermediate_image_sizes','simple_remove_default_images');
//// prevent generation of all thumbnails except 300px for media library
remove_image_size('thumbnail'); //// useless clutter
////remove_image_size('medium'); //// keep for media library
remove_image_size('medium_large'); //// useless clutter
remove_image_size('large'); //// useless clutter
remove_image_size('1536x1536'); //// twentysixteen garbage?
remove_image_size('2048x2048'); //// twentysixteen garbage?
remove_image_size('post-thumbnail'); //// useless clutter
Put that in your theme's functions.php file, and the madness will end. Also, go into Settings > Media and zero-out the medium and large icon settings. Then get the Regenerate Thumbnails plugin. Run it with the 'delete unused' setting, and clean up your media library. That will probably make a lot of broken links, find and fix with a link checker plugin. None of this is easy or quick if you have a large site.
This image insanity in WordPress is some of the worst programming I have ever seen. I'm sure the authors are all very proud of it, as are their professors. WordPress is drowning in a deep pool of its own excrement. I'm almost ready to give up on it.