By default, a set of alternate sizes are generated for images that are uploaded to a site’s WordPress media library. These alternate sizes are referred to as “intermediate images”. WordPress core defines a default array of intermediate image sizes:
large. The pixel dimensions for each of these default sizes can be defined in the Settings –> Media screen of the WordPress Admin dashboard.
On a typical WordPress install, intermediate image sizes are generated as separate files (e.g.,
On the VIP Platform, separate files are not created for intermediate images. Only the original (
full) size version of the uploaded file is stored on the VIP File System. The intermediate sizes for an image are dynamically generated at the time of a request (e.g.,
image.jpg?w=300&h=300&crop=1), and then cached by the edge cache.
Additional custom intermediate image sizes can be registered for a site with the
add_image_size() function in a theme or a plugin.
Because intermediate image sizes are dynamically generated, the separate intermediate image files generated by typical WordPress install are not needed on VIP. When preparing content for importing media to an application, avoid including intermediate images. This can reduce the size of the exported content by up to 95% and increase the speed of the import.
Because of VIP’s custom method for handling intermediate image sizes, some WordPress functions will not work as expected.
get_intermediate_image_sizes()will always return an empty array.
- The WP-CLI command
wp media image-sizewill only return the
fullsize of an image, any custom registered image sizes, and two image sizes for higher density devices supplied by WordPress core:
Intermediate image sizes in WordPress templates
Functions such as
the_post_thumbnail() can be used to output images of a specific registered image size in a WordPress template. For example:
the_post_thumbnail( 'medium' );.
These functions will not only output an image at a specific size, but will generate a responsive
srcset for the image as well.
Last updated: August 16, 2023