Categories & Media Library

The filter buttons come from Gallery Categories: a taxonomy that images, posts and pages share. Categories live on the media item itself, so a photo tagged once is filtered correctly in every gallery it appears in.

The Gallery Categories taxonomy

  • Taxonomy name gallery_z_category, hierarchical and public.
  • Attached to media, posts and pages. Developers can add other post types with the gallery_z_taxonomy_object_types filter.
  • Each category has an archive at /gallery-category/<slug>/ – in block themes it uses the Gallery Category Archive template.
  • Usable in the Query Loop’s taxonomy filter, like any other taxonomy.

A gallery doesn’t have to use Gallery Categories: under Filtering → Filter by it can filter by any public taxonomy, such as regular post categories or tags.

In the editor

  • One image: the Gallery categories panel in the sidebar of an Image block inside a gallery. It saves straight to the attachment.
  • Several images: select them and use the tag button in the block toolbar, or the Tag selected images command. See Editing.
  • Posts and pages: the Gallery Categories panel in the post sidebar.

In the Media Library

For tagging a whole shoot at once, the Media Library is quicker.

List view

  • A Gallery Categories column. Each category links to the list filtered by it.
  • A category filter dropdown above the list.
  • Bulk actions Add to gallery category… and Remove from gallery category…, with a category picker next to them.
  1. Go to Media → Library and switch to the list view.
  2. Tick the images.
  3. Choose Add to gallery category… in the bulk actions, pick the category and click Apply.

Grid view

A Filter by gallery category dropdown in the toolbar, next to core’s filters.

Attachment details

In the attachment details of the media modal, Gallery Categories appear as a checklist instead of core’s text field of comma-separated slugs.

Tips

  • Keep the category names short: they become button labels.
  • Order the buttons in the filter’s settings (Taxonomy, categories), or hide empty ones.
  • Use child categories for fine-grained archives; a Media Query with Use the archive’s category includes the children.
  • Imported galleries bring their tags along as Gallery Categories – see Switching.
  • AI agents can tag images for you through the Abilities API.