What is a Gallery in WordPress?
A gallery in WordPress is a collection of images displayed together in a grid on a post or page. WordPress builds galleries natively with the Gallery block, which arranges photos from your Media Library in up to 8 columns with an optional lightbox; video galleries and layouts like masonry or sliders require a plugin.
More About Galleries
WordPress builds galleries with the Gallery block, which arranges the photos you choose in a grid on any page or post. You control the number of columns (up to 8), whether thumbnails are cropped to a uniform shape, and the resolution the grid loads. You can caption the whole gallery or any single image.
The default gallery is a static grid that scrolls with the page. Turn on the optional Enlarge on click setting and visitors can open any image in a lightbox, then move forward and backward through the gallery without leaving the page. Swiping between images is a feature of slider and carousel galleries, which usually come from plugins, not of the built-in grid.
Creating a gallery with the Gallery block
In the block editor, click the + block inserter and choose Gallery, or type /gallery and press Enter. Add images in any of three ways: upload new files (WordPress adds them to your Media Library at the same time), pick media items you've already uploaded, or drag and drop images straight into the block. Drag the thumbnails to reorder them.
Each image inside a gallery is its own Image block. Selecting one shows controls for that image alone; the Select parent block: Gallery button in the toolbar returns you to the gallery-wide settings for columns, cropping, and image resolution. A Link option applies to every image at once: link images to their attachment pages or media files, turn on Enlarge on click for the lightbox, or choose None.
A gallery concentrates a lot of image weight on one page, so resize and compress photos before you upload them. Our guide to fixing common image issues in WordPress walks through how.
When to use a gallery plugin
Start with the built-in block and add a plugin only when you hit a wall it can't clear. Since WordPress 6.4 (November 7, 2023), the lightbox is native, which removed the most common reason to install one.
- Use the Gallery block for an image grid with columns, captions, and click-to-enlarge. It covers most posts and pages.
- Reach for a gallery plugin when you need masonry or slider layouts, albums that group multiple galleries, video or mixed-media galleries, watermarking, or proofing and ecommerce features.
Portfolios are the usual exception: albums and space-saving layouts matter most when you're showing a large body of work, and that's plugin territory.
Galleries in the classic editor
Sites on the classic editor build galleries with the gallery shortcode instead of a block. Click Add Media above the editor, choose Create a Gallery, select or upload your images, and WordPress inserts the shortcode that renders the grid. Settings are slimmer there: thumbnail links, columns (3 by default), random order, and image size.
Frequently Asked Questions
Powerful WordPress Hosting
Reliable, lightning-fast hosting solutions specifically optimized for WordPress. Find the perfect plan for you by clicking below.
WordPress Hosting Plans