A folder of photos from a recent job is sitting on your phone, and you want them on the website as a tidy grid rather than a long column of single images that visitors have to scroll past. You know WordPress can do it. What is less obvious is how to get the grid even, the order right and the clicks behaving the way you expect.
To add a gallery in WordPress you need nothing beyond the editor itself: the Gallery block handles the grid, the columns, the cropping and the captions. Below is the whole process, from choosing the photos to fixing the order after you have published.
Before you build the gallery
Three quick decisions make the rest easier.
- Is the page in the block editor? If the page opens in Elementor, Divi or a theme’s own builder, use that builder’s gallery widget instead. The thinking below still applies.
- Are the photos ready? Phone photos are much larger than any website needs. Shrink them first. Our free image compressor resizes and compresses in the browser, and a gallery of lighter files loads far more quickly.
- Do they share a shape? A grid looks neatest when the photos are all wide or all upright. A mix can work, but you will want the crop setting described below.
Rename the files to something descriptive before upload, such as kitchen-tiling-after.jpg. It costs nothing and makes the Media Library searchable later. If the Media Library itself is still a mystery, the WordPress images and media guide explains how uploads, sizes and alt text fit together.
How to add a gallery in WordPress
- Open the page or post and click where the gallery should appear.
- Click the + inserter, search for “Gallery” and choose the Gallery block.
- Choose Upload to pick files from your computer, or Media Library to use images that are already on the site.
- In the Media Library window, click each image you want. Every selected image shows a tick, and clicking it again removes it from the selection.
- Click Create a new gallery. The next screen shows your selection, where you can drag to reorder and type captions.
- Click Insert gallery.
- Save a draft and preview it on desktop and on a phone.
You can also drag a handful of image files from your desktop straight onto an empty Gallery block. WordPress uploads them and builds the grid in one go.
The Gallery block settings that matter
Select the Gallery block itself (not one image inside it) and open the settings sidebar. Clicking a photo selects only that photo. To reach the gallery, click the Gallery line in the List View, or click a photo and then the small parent icon that appears first in its toolbar.
Columns
The Columns slider sets how many images sit side by side on a wide screen. Three or four suits most business galleries. On phones the grid narrows to fewer columns on its own, so do not worry about the mobile view when choosing.
Crop images
With the crop option on, which is the default, WordPress trims every image to fill an even grid. Rows line up neatly, but the edges of upright photos get cut. Turn it off and each image keeps its full shape, which suits work where the whole picture matters, like artwork or floor plans, at the cost of a ragged grid. Try both and keep the one that suits your photos.
Image size
There is a resolution or image size setting that decides which copy of each photo the grid loads: thumbnail, medium, large or full size. Large is usually a sensible balance. Full size on a grid of small tiles makes visitors download far more than they see.
Link settings
The link button in the gallery toolbar decides what happens when someone clicks a photo. The wording in the menu varies a little by version; in current WordPress it reads as below.
| Option | What the visitor gets | Good for |
|---|---|---|
| None | Nothing happens on click | Small decorative grids |
| Link images to media files | The full image opens on its own, or in a lightbox if your theme or a plugin adds one | Sites that already use a lightbox plugin |
| Link images to attachment pages | A separate page for that image | Rarely useful for a business site |
| Enlarge on click | A larger view over the page, with next and previous buttons to move through the gallery in current versions | Most portfolios and project photos |
Some earlier versions called this option “Expand on click”, and older ones do not have it at all. Our post on adding a click-to-enlarge lightbox covers the options in more detail, including plugins.
Captions in a gallery
Each photo in a Gallery block is an ordinary Image block inside it. That means you can click any one photo and type a caption beneath it, or set its alt text in the sidebar, without touching the rest.
The gallery also has its own caption for the whole set, which appears under the grid. Use that for a single line such as the project name and location, and per-image captions only where they add something (“before”, “after”, “second-floor bathroom”). Captions on every tile in a dense grid quickly look cluttered.
Alt text matters for galleries too. A visitor using a screen reader hears each image in turn, so a short description of what each photo shows is worth the minute it takes.
Reordering, adding and removing images
Galleries change. You finish another job, or a client asks you to take a photo down.
- To reorder: click a photo in the grid and use the move left and move right arrows in its toolbar. You can also drag photos, or move them in the List View, which is easier with a long gallery.
- To add more: select the gallery and click Add in its toolbar, then upload or choose from the library. New images go to the end; move them afterwards.
- To remove one: click the photo, open its options menu (the three dots) and choose to delete it. The file stays in the Media Library; it only leaves the gallery.
Removing an image from the gallery and removing it from the site are separate things. If a client has asked for a photo to be taken down everywhere, also delete it from Media → Library, after checking it is not used on another page.
Where a gallery belongs
A Gallery block on a single page is fine for a handful of projects. If you are building a full portfolio with many projects, each with its own page, you probably want a structure rather than one huge gallery. Our post on adding a portfolio to WordPress covers that bigger setup. For a single service page, one gallery of your best recent work usually says more than three galleries of everything.
When it does not look right
Some small problems have simple fixes:
- Uneven rows: turn crop on, or use photos of the same shape.
- Gaps between images too wide or too tight: look for a Block spacing control under the dimensions settings in the block’s Styles tab. Some themes set this for you.
- Clicking does nothing: the link setting is probably “None”.
- Something went wrong while editing: Undo (Ctrl+Z or Cmd+Z) works on gallery changes, and the page’s revisions let you go back to the version from before you started.
Grey boxes instead of photos, a grid that has collapsed into one column, or a lightbox that stopped opening are faults rather than settings. Our troubleshooting post on a WordPress gallery that is not working walks through those causes.
Habits worth dropping
Uploading camera originals is the commonest one; the gallery looks fine on your fast office connection and crawls on a customer’s phone. The second is using photos of other people’s homes, faces or cars without permission. The third is a gallery so long that nobody reaches the end. Pick the best, and keep a few in reserve to swap in later.
Photos are only one part of keeping a business site current; menus, plugins, forms and users are covered elsewhere in our WordPress owner’s guide.
Frequently asked questions
Can I reuse the same gallery on several pages?
Yes. Select the Gallery block, open its options menu and create a synced pattern from it. You can then insert that pattern on other pages, and editing it once updates it everywhere. If you only want a starting copy to change separately, copy the block and paste it into the other page instead.
Can I turn existing images in a page into a gallery?
Often, yes. Select the separate Image blocks together, then use the transform option at the left of the toolbar and choose Gallery. WordPress groups them into one Gallery block, keeping their captions and alt text. If the option does not appear, insert a new gallery and pick the same images from the library.
Why are my gallery photos in a different order on the live page?
Check whether the gallery’s random order option is switched on in the block settings, if your version has it. If not, you may be seeing a cached copy of the page from before you reordered. Clear your caching plugin’s cache and reload the page in a private window.
Is there a limit to how many images a gallery can hold?
The block has no small fixed limit, but every image adds to what visitors must download, and the editor itself gets slower with very large galleries. If you have dozens of photos, split them by project or service across separate pages rather than putting everything in one grid.
A gallery that broke after an update or a move, and stays broken after the checks above, needs its cause traced rather than the block rebuilt. That is the kind of work our WordPress bug fixing service handles.
Next in this series: Media and Text Block in WordPress: Image Next to Text