We have a series of posts some do not have a defined thumbnail size (i.e. "small-featured"). Right now with the_post_thumbnail() if WordPress can not find that size it replaces it with the original size in a listing page we created.

Is it possible to request that if that exact size does not exist don't display an image instead of forcing a massive original image?


  • Can You provide the code snippet of your theme template where You call the_post_thumbnail(), cause if function not find the image, it must return null(empty) ' '. Looks like this modified by theme filters or etc. Also You can try to set the size of thumb. with first param thumbnail, medium, large, full.
    – Nik Horse
    Commented Jan 11, 2019 at 9:57
  • You could use the Regenerate Thumbnails plugin, which can go through your whole media library and add those missing sizes. As long as all of your desired image sizes are still set up, it will generate each size for each file.
    – WebElaine
    Commented Jan 11, 2019 at 20:55
  • Thanks @WebElaine problem is we have well over 400K - 500K images
    – Hossj
    Commented Jan 12, 2019 at 4:13
  • It runs on any number of images.
    – WebElaine
    Commented Jan 14, 2019 at 1:30


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.