Hey @victorhugo,
Thank you for your feedback.
We will be working on an new templating system and will have a new system of clearer documentation when the new templates are released. However, WordPress development knowledge is still expected for someone utilizing custom templates.
Due to the nature of WordPress’s image size generation, when an image size is added to WordPress, it will create those sizes for all images. This is done so that images can be selected within various plugins and themes using the same image.
Having multiple images sizes of the same ratio is also not a bad thing as it allows more image sizes to be in the same srcset
for an image, giving users on various screen sizes an optimal and faster experience.
However, because we understand that some sites may need to be more concerned about the number of files created, Create has the ability to limit the number of sizes generated. The function provided below can be added as a separate plugin or in your functions.php
file.
A few caveats here:
- If an image is not big enough to be cropped down by WordPress, then the ratio will be incorrect, and Google schema will recognize them.
- If you need a smaller image because of that, you should remove one of the higher resolution images, and add mv_create_{size}_high_res to the array of sizes to be unset.
- This will only affect new images, and not the ones that have had images already generated. To remove those images, you will need to manually find those images and remove them, they will be the ones ending in: 200×200, 320×320, 480×480, 320×240, 480×360, 320×180, 480×270
- If you decide to manually remove images, be careful, as other plugins and/or your theme may be using that image size somewhere.
function remove_mv_create_image_sizes( $img_sizes ) {
$img_sizes_to_remove = array(
'mv_create_1x1',
'mv_create_1x1_medium_res',
'mv_create_1x1_medium_high_res',
'mv_create_4x3',
'mv_create_4x3_medium_res',
'mv_create_4x3_medium_high_res',
'mv_create_16x9',
'mv_create_16x9_medium_res',
'mv_create_16x9_medium_high_res',
);
foreach ( $img_sizes_to_remove as $img_size_to_remove ) {
unset( $img_sizes[ $img_size_to_remove ] );
}
return $img_sizes;
}
add_filter( 'mv_create_image_sizes', 'remove_mv_create_image_sizes' );
Seth Alling
Mediavine