Title: Default Gallery Settings
Last modified: December 23, 2025

---

# Default Gallery Settings

 *  Resolved [Josh Journey](https://wordpress.org/support/users/ljosh/)
 * (@ljosh)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/default-gallery-settings-2/)
 * Is it possible to set the default settings when creating a GutenBee gallery block?
   For example when creating a GutenBee gallery, if the gallery type could start
   with Justified, have row height set to 250, margins 10, show captions, and link
   to the media file by default these make for a beautiful gallery. Each post I 
   create has multiple gallery blocks making it a pain to configure every time. 
   With the native WP gallery block I coded the following for functions.php which
   sets the default when inserting a block:
 *     ```wp-block-code
       function my_block_type_metadata($settings, $metadata){    if ($settings['name'] == 'core/gallery') {	$settings['attributes']['sizeSlug']['default'] = 'medium';        $settings['attributes']['columns']['default'] = 4;        $settings['attributes']['linkTo']['default'] = 'media';    }	return $settings;}add_filter('block_type_metadata_settings', 'my_block_type_metadata', 10, 2);
       ```
   
 * I tried to code a version for GutenBee but can’t even get a print out of the 
   attributes. I got the name ‘gutenbee/justified-gallery’ from editing a post with
   Classic Editor. But perhaps the settings name is a little different?
 *     ```wp-block-code
       function gutenbee_metadata($settings, $metadata){    if ($settings['name'] == 'gutenbee/justified-gallery') {        print_r($settings['attributes']);    }	return $settings;}add_filter('block_type_metadata_settings', 'gutenbee_metadata', 10, 2);
       ```
   
 * Any pointers would be greatly appreciated.
   Warm regards.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Anastis Sourgoutsidis](https://wordpress.org/support/users/anastis/)
 * (@anastis)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/default-gallery-settings-2/#post-18768506)
 * Hi Josh,
 * add a new gallery block, change the settings that you want to be the defaults,
   and when you are ready, remove the images and click on the three dots button 
   and then “Create pattern”. Type a name, such as “Justified gallery” or something
   else that will help you find it, and make sure the “Synced” checkbox is unchecked.
   Finally, press Add.
 * Now you can add the “Justified gallery” pattern easily from the block inserter,
   with the defaults you specified. You essentially created a one-block pattern.
   No code necessary 😀
 * Happy holidays!
    -  This reply was modified 3 months, 3 weeks ago by [Anastis Sourgoutsidis](https://wordpress.org/support/users/anastis/).
 *  Thread Starter [Josh Journey](https://wordpress.org/support/users/ljosh/)
 * (@ljosh)
 * [2 months, 3 weeks ago](https://wordpress.org/support/topic/default-gallery-settings-2/#post-18796526)
 * [@anastis](https://wordpress.org/support/users/anastis/) Thank you very much 
   for showing me this awesome technique!
   One issue remains which is creating a 
   default image source. When editing a Gutenbee gallery block, the block setting
   > Image settings > Image Size only appears when there are images already selected
   for the block. When adding images, inserting, then removing images from a gallery;
   the ‘Add to Gallery’ button fades and does nothing on click (unless an image 
   is added back). A gallery that has had images added requires images to allow 
   being updated – a WP imposed restriction. Even when removing from the button ‘
   Add to Gallery’ attribute disabled=”disabled”, the button does nothing.
 * Fortunately I can work around this and convert the gallery to HTML. Followed 
   by manually removing the images, then set it back to visual:
 *     ```wp-block-code
       <div id="block-28470b-7621-84" class="wp-block-gutenbee-justified-gallery block-28470b-7621-84 wp-block-gutenbee-gallery-justified" data-gallery-type="justified" data-row-height="120" data-margins="1" data-last-row="nojustify" data-randomize="false"><div class="wp-block-gutenbee-gallery-content"></div></div>
       ```
   
 * This sets the Gutenbee to a blank gallery. But the gallery settings again require
   an already selected image to show the Image Size setting. In a future update 
   could Gutenbee’s Image Size setting please display even if the gallery has 0 
   images? This would allow the creation of patterns with having a pre-selected 
   image source but without having already selected images.
 * Warm regards,
   Josh
 *  Plugin Author [Anastis Sourgoutsidis](https://wordpress.org/support/users/anastis/)
 * (@anastis)
 * [2 months, 3 weeks ago](https://wordpress.org/support/topic/default-gallery-settings-2/#post-18798165)
 * Hi Josh,
 * if I remember correctly, the image sizes dropdown is populated based on information
   returned by the images themeselves, so it’s (probably) not possible to pre-populate
   it before selecting any images.
 * But, assuming you just need that to create patterns with a specific size, you
   should keep the block information when removing the images, i.e. the **<!– wp:
   gutenbee/justified-gallery…** and **<!– /wp:gutenbee/justified-gallery –>** lines:
 *     ```wp-block-code
       <!-- wp:gutenbee/justified-gallery {"uniqueId":"36d6e8-47d5-4a","size":"large"} --><div id="block-36d6e8-47d5-4a" class="wp-block-gutenbee-justified-gallery block-36d6e8-47d5-4a wp-block-gutenbee-gallery-columns gutenbee-columns-3" data-gallery-type="columns" data-row-height="120" data-margins="1" data-last-row="nojustify" data-randomize="false"><div class="wp-block-gutenbee-gallery-content"></div></div><!-- /wp:gutenbee/justified-gallery -->
       ```
   
 * The **“size”:”large”** bit on the first line is the size I selected before I 
   removed the image. Any images added to this gallery will then have this size 
   preselected.
 * Hope this helps.
 *  Thread Starter [Josh Journey](https://wordpress.org/support/users/ljosh/)
 * (@ljosh)
 * [2 months, 3 weeks ago](https://wordpress.org/support/topic/default-gallery-settings-2/#post-18800556)
 * [@anastis](https://wordpress.org/support/users/anastis/) Fantastic! Using your
   HTML comments was able to create a pattern with the image size pre-selected. 
   Step one is to create a simple gallery, edit as HTML, remove all gallery items
   leaving the 2 parent DIVs. Then I place in your HTML comment above and below.
   Convert to visual. Attempt recovery. Save as pattern. Then place gallery blocks
   using this saved pattern. It’s working beautifully. 😊
   Thank you so much for 
   all your help with setting defaults that work within our workflows. This is a
   huge improvement. Wishing you a wonderful week ahead.
 * Warm regards.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdefault-gallery-settings-2%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/gutenbee/assets/icon-256x256.png?rev=2917794)
 * [GutenBee - Gutenberg Blocks](https://wordpress.org/plugins/gutenbee/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gutenbee/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gutenbee/)
 * [Active Topics](https://wordpress.org/support/plugin/gutenbee/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gutenbee/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gutenbee/reviews/)

## Tags

 * [block](https://wordpress.org/support/topic-tag/block/)
 * [default](https://wordpress.org/support/topic-tag/default/)
 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [settings](https://wordpress.org/support/topic-tag/settings/)

 * 4 replies
 * 2 participants
 * Last reply from: [Josh Journey](https://wordpress.org/support/users/ljosh/)
 * Last activity: [2 months, 3 weeks ago](https://wordpress.org/support/topic/default-gallery-settings-2/#post-18800556)
 * Status: resolved