Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Blogging & content · Guide

How to Add Image Gallery in WordPress (Step by Step)

How to Add Image Gallery in WordPress (Step by Step)

Short answer

Open your post or page in the block editor, add a Gallery block, then upload images or pick them from the Media Library. Set columns, cropping, image size and link behaviour in the block settings, add captions and alt text, and publish when the preview looks right.

Key takeaways

  • The built-in Gallery block covers most needs without a plugin.
  • Columns, cropping, resolution and links live in the block settings.
  • Each gallery image is its own Image block with alt text and caption.
  • Use a plugin only for albums, filters, proofing or advanced lightboxes.
  • Resize and compress images before upload to keep pages fast.

You add a gallery with the built-in Gallery block: insert the block, pick or upload images, then set columns, cropping and links in the block settings.

No plugin is needed for a basic gallery. The block ships with WordPress and works in posts, pages and, on block themes, in templates.

Plugins only make sense when you need extras such as albums, filtering, watermarks or proofing for clients. Most blogs and business sites never reach that point.

This guide walks through the block step by step, then covers the classic editor, page builders, plugins and the speed checks that keep a photo-heavy page fast.

MethodBest forExtra cost
Gallery blockMost posts and pagesNone
Classic editor gallerySites still on the Classic EditorNone
Page builder widgetSites built in Elementor or similarDepends on the builder
Gallery pluginAlbums, filters, lightbox effects, proofingFree and paid tiers

What do you need before you start?

You need a WordPress user role that can upload files, such as Author, Editor or Administrator, plus the images you want to show.

Contributors cannot upload media by default. If the upload option is missing, ask an administrator to change your role or upload the images for you.

Prepare the images first. Resize them to a sensible width, usually no wider than your content area allows on large screens, and compress them before upload.

Our guide on how to properly size images in WordPress explains how to choose dimensions that look sharp without bloating the page.

Give files clear names before upload, such as red-barn-sunset.jpg rather than IMG_4021.jpg. File names show up in the Media Library and make images easier to find later.

Open the post or page in the block editor, click the plus icon, search for Gallery and select it.

You can also type a forward slash on an empty line, then /gallery, and press Enter. The block appears with three choices: Upload, Media Library and, in recent versions, Insert from URL.

The official Gallery block documentation on WordPress.org lists every setting, and it is worth a quick look if your screen differs from the steps here.

Menus move slightly between WordPress versions. If a label below does not match, look for the same option in the block toolbar or the settings sidebar on the right.

Step 2: Add your images

Choose Upload to pick files from your computer, or Media Library to reuse images already on the site.

In the Media Library window, click each image you want. A tick marks every selected file, and the order you click is the starting order of the gallery.

Click Create a new gallery. WordPress shows an edit screen where you can drag images into a new order and add captions.

When you are happy, click Insert gallery. The images now appear in a grid inside the editor.

To add more images later, select the gallery and use the Add button in the block toolbar. New images join the end of the grid, and you can move them from there.

If uploads fail with an error, our fix for the HTTP error when uploading images covers the usual causes, such as file size limits and server memory.

Step 3: Set columns, cropping and size

Select the gallery block, then open the settings sidebar to change the number of columns, cropping and the image resolution.

Columns controls how many images sit side by side. Three or four columns suit most content widths; two works well for larger, detailed photos.

Crop images to fit trims images so every tile has the same shape. Turn it off if your photos have mixed orientations and you do not want heads or edges cut off.

Resolution picks which saved size WordPress loads, such as Thumbnail, Medium, Large or Full Size. Large is usually enough for a grid; Full Size loads the original file and can slow the page.

Since WordPress 5.9, each image inside a gallery is its own Image block. That change, described in the gallery refactor developer note, means you can click a single image to change its alt text, caption or link.

Step 4: Choose what happens on click

The link setting decides whether clicking an image does nothing, opens the image file, opens an attachment page or, in recent versions, enlarges it in a lightbox.

Pick None for a simple visual grid. This is a good choice when the images are decorative or already large enough to see.

Pick the image file option if visitors need the full-resolution version, for example product details or artwork. Add Open in new tab if you do not want people to leave the article.

Recent WordPress versions add a built-in enlarge-on-click option, often called a lightbox. Check the link menu in your version; if it is missing, a gallery plugin can add the same effect.

Avoid attachment pages unless you have a reason to use them. They create thin pages with one image and little text, which rarely helps visitors or search.

Step 5: Add captions and alt text

Add a short caption under the gallery or under single images, and write alt text for every image that carries meaning.

Click an image inside the gallery to select it. In the sidebar, fill in Alternative text with a short description of what the image shows.

Alt text helps screen reader users and gives search engines context. The W3C alt decision tree is a useful guide when you are unsure whether an image needs it.

Captions are optional. Use them when the image needs context the reader cannot get from the picture, such as a location, a date or a product name.

For more on naming and describing images, read our guide on how to optimize images for SEO in WordPress.

Drag images within the gallery, or use the move arrows in each image's toolbar, to change the order before you publish.

Recent versions include a Randomize order toggle in the gallery settings. It shuffles images on each page load, which suits portfolios or mood boards but not step-by-step photo sequences.

Under the Styles tab, you can often change spacing between images, add rounded corners or apply a block style your theme provides. The exact options depend on your theme.

When the layout looks right, click Preview to check it on the front end, then publish or update the page.

In the Classic Editor, click Add Media, choose Create Gallery, select images, then click Create a new gallery and Insert gallery.

The gallery appears in the editor as a placeholder. Behind the scenes, WordPress inserts a gallery shortcode with the image IDs.

You can edit the shortcode by hand to set columns, image size and links. The gallery_shortcode function reference lists the attributes it accepts, such as ids, columns, size and link.

A typical shortcode looks like this:

[gallery ids="12,15,18,21" columns="4" size="medium" link="file"]

If you plan to move to the block editor later, the Classic block can convert existing galleries into Gallery blocks. Check each converted page, because some settings may not carry over exactly.

Use a plugin only when you need features the block lacks, such as albums, tag filtering, video in galleries, watermarking, client proofing or advanced lightbox effects.

Popular choices in the plugin directory include FooGallery and NextGEN Gallery. Both offer free versions with paid add-ons; check the plugin pages for current features and prices.

Plugins add code and sometimes extra database tables. Install one, test it on a staging copy if you can, and remove any you stop using.

Photographers and portfolio sites gain the most from these tools. Our look at whether WordPress is good for photographers covers the wider setup for image-led sites.

If you build pages in Elementor or another page builder, check its own gallery widget first. It usually matches your design better than mixing in another plugin.

Upload right-sized, compressed images, load a sensible resolution and let lazy loading defer images below the fold.

WordPress adds the loading attribute to most images by default, so off-screen gallery images wait until the visitor scrolls. The web.dev guide to browser-level lazy loading explains how that works.

Large galleries still add weight. If you have more than 20 or 30 images, think about splitting them across several pages or linking to a dedicated portfolio page.

Modern formats help too. Our guide to serving images in next-gen formats shows how WebP and AVIF can cut file sizes.

After publishing, run the page through a speed test and look at total image weight. If it is heavy, drop the resolution setting from Full Size to Large.

Most gallery problems come from theme styles, a caching plugin serving old files, or images that failed to upload properly.

If the grid looks broken on the live site but fine in the editor, clear your cache and check again. Theme CSS can also override block styles, so test with a default theme on staging.

If images are missing completely, our guide on images not showing in WordPress walks through file permissions, URLs and CDN issues.

If captions or alt text disappear after switching editors, re-open each image in the gallery and re-enter the text, then save.

A quick checklist after publishing:

  • View the page on a phone and a desktop.
  • Click a few images to test links.
  • Check that captions are readable on dark and light backgrounds.
  • Confirm the page still loads quickly.

Frequently asked questions

Do I need a plugin to make a gallery in WordPress?

No. WordPress includes a Gallery block that handles grids, columns, cropping, captions and links. A plugin is only worth adding if you need albums, filtering, watermarks, client proofing or special lightbox effects.

How many images can I put in a WordPress gallery?

There is no fixed limit in the block, but large galleries slow pages down. Keep most galleries under about 20 to 30 images, use a sensible resolution, and split very large sets across several pages.

How do I change the order of images in a gallery?

Select an image inside the gallery and use the move arrows in its toolbar, or drag it to a new spot. In the Classic Editor, drag images in the Edit Gallery screen before inserting.

Why are my gallery images cropped?

The Crop images to fit setting is turned on. It trims images so tiles share the same shape. Turn it off in the gallery settings to show each image in its original proportions.

Can I make gallery images open larger when clicked?

Yes. Set the gallery link option to the image file, or use the enlarge-on-click lightbox option found in recent WordPress versions. Older versions need a gallery plugin for a lightbox.

Sources

  1. Gallery block WordPress.org Documentation
  2. gallery_shortcode() WordPress Developer Resources
  3. Gallery Block Refactor Dev Note Make WordPress Core
  4. Browser-level image lazy loading for the web web.dev
  5. An alt Decision Tree W3C Web Accessibility Initiative

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.