Since Wordpress 5.x they've removed the thumbnail size option for galleries. Is there a way to activate or build a workaround? I like to build up a classic Lightbox gallery.

enter image description here

2 Answers 2


There is a project going on about the image sizes. You can follow it right here.

Right now, you can try using shortcode_atts_gallery filter. Take a look at these codes to get a hint:

/* Register shortcode_atts_gallery filter callback */
add_filter( 'shortcode_atts_gallery', 'meks_gallery_atts', 10, 3 );

/* Change attributes of wp gallery to modify image sizes for your needs */
function meks_gallery_atts( $output, $pairs, $atts ) {

/* You can use these sizes:
- thumbnail
- medium
- large
- full
or, if your theme/plugin generate additional custom sizes you can use them as well

$output['size'] = 'medium'; //i.e. This will change all your gallery images to "medium" size

return $output;


You can find more information about shortcode_atts_gallery right here.

  • Nice idea but that is for Wordpress 4.x ... There is no gallery tag using anymore. Its a new WYSIWYG Block Editor Element.
    – Pete
    Feb 9, 2019 at 14:45

It's an ongoing process. Right now there is not a way to adjust manually the image sizes on the gallery block. It is being discussed by the WordPress core development community on this github issue.

Just because the default gutenberg gallery block does not allow you to do it does not mean you cannot install a 3rd party plugin, create a custom block yourself (I recommend using ACF Custom Blocks), or reverting to the classic editor for this specific use.

  • Okay thanks. I guess I'll downgrade to 4.9.9 for the time of waiting :)
    – Pete
    Feb 10, 2019 at 11:47
  • 1
    To be clear you don't need to downgrade to 4.9.9 to use the classic editor. You can install the Classic Editor Plugin.
    – tmdesigned
    Feb 10, 2019 at 12:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.