Are you looking to create an image gallery in WordPress?
An image gallery lets you add photos in rows and columns. This allows you to display more photos in less space while also making it easier for users to browse them.
In this article, we will show you how to easily create an image gallery in WordPress that makes your photos look even better.
Why Create an Image Gallery in WordPress?
WordPress makes it super easy to add an image to your blog posts and pages. You just need to add the image block and upload your image.
However, if you are adding multiple images, then all those images will appear one after another. It doesn’t look great, and your users will have to scroll a lot to view them all.
By creating a gallery, you can display images in a grid layout with columns and rows. You can show thumbnails for your pictures, and users can click on them to see the full image.
This way, you will be able to show more photos in less space, and it will look a lot more professional.
WordPress actually comes with a built-in gallery feature for quickly creating photo galleries. The new WordPress block editor includes a Gallery block to let you make a WordPress gallery in just a few clicks.
You can also use WordPress image gallery plugins to create even more robust galleries with more features.
In this tutorial, we will show you both methods to make a photo gallery in WordPress.
Let’s start with the default WordPress gallery block.
Video Tutorial
If you don’t like the video or need more instructions, then continue reading.
Method 1. Create an Image Gallery without a Plugin
WordPress comes with a built-in feature that lets you create a gallery. This feature is very basic and does not have many options, but it gets the job done.
Here is how you would create an image gallery in WordPress without using a plugin.
First, you need to edit the post or page where you want to add the image gallery. On the post edit screen, click on the Add New Block icon and select the Gallery block.
This will add the Gallery block to your WordPress editor where you can click on the ‘Upload’ button to upload photos from your computer. You can also select from previously uploaded photos in the media library.
If you click on the Upload button, then you can generally upload one photo at a time. However, you can select and open multiple images with Ctrl key pressed on your keyboard.
After you have uploaded all the images, you can add captions to your images. Simply click on the photos, and you will see ‘Write caption…’ option where you need to enter the caption.
If you select the Media Library button, then you will be able to choose images for your gallery all at once. As you select images, you can also enter the image alt text, title, and caption from the attachment details panel on the right side.
Select the images you want to add and click on the ‘Create a new gallery’ button at the bottom right corner.
Next, you will see ‘Edit Gallery’ page where you can add/review your image captions. Once done, click on the ‘Update Gallery’ button at the bottom right corner.
After that, your post edit screen will open with the gallery block settings panel on the right side. Now, you can choose the number of columns for each row, enable or disable the Crop images option, and choose where to link your gallery images.
From the Link to options, you can choose None if you want your users to only view your photo. This option disables clicking feature for your images.
If you select the Media File option, then the images will be clickable, and the image file will open when clicked. Similarly, the attachment page will open if you select the Attachment Page option.
Once you are satisfied with the settings, you can publish the post and preview the gallery on your live website.
For example, here is how the image gallery appeared on our demo website.
Wasn’t that quick and easy?
It looks pretty too. However, if you create image galleries regularly, then you will soon notice that it lacks certain essential features.
For example, your images will either be not clickable or open in a new page. If you link your gallery images to the media file or attachment page, then the users will have to click on the back button to view the gallery again.
It is not user-friendly, and your gallery’s appearance depends on your theme. In most cases, you get just one very generic style.
You can’t organize your galleries into topics, albums, tags, etc. Your gallery is not stored anywhere and if you needed to add the same gallery again, then you’ll have to recreate it.
If you want to add more professional looking image galleries on your site, then you should use the next method.
Method 2. Create an Image Gallery Using Envira Gallery
For this method, we will be using the Envira Gallery plugin. It is the best WordPress image gallery plugin in the market.
Envira allows you to easily create fully-responsive, beautiful, and modern image galleries in WordPress. It is super fast and comes with many features like lightbox popup, easy image navigation, drag and drop builder, and professional gallery templates.
Let’s get started.
First thing you need to do is install and activate the Envira Gallery plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you need to visit the Envira Gallery » Settings page to enter your license key. You can get this key from your account on the Envira Gallery website.
After verifying your license key, you can head over to Envira Gallery » Add New page to create your first gallery.
First, you need to provide a title for your gallery and then click on ‘Select files from computer’ button to upload your images.
You can also select files from your WordPress media library by clicking on ‘Select files from other sources’ button.
Once you upload the images, they will appear in the Gallery section.
You can click the pencil icon on an image to add caption, title, and alt text for each image.
Next, you need to click on the ‘Configuration’ tab.
From here you can change your gallery settings like the number of columns, image lazy loading, title and caption positioning, margins, heights, thumbnail sizes, image dimensions, etc.
After that, you need to click on the ‘Lightbox’ tab.
The lightbox popup allows users to enlarge images and browse them without ever leaving the page.
The default settings will work very well for most websites, but you can review the options and change them if you like.
Next, you can click on the ‘Mobile’ tab to configure your gallery settings for mobile devices. It allows you to choose image dimensions for mobile devices, enable or disable lightbox, and more.
After that, you can review more options like gallery slug and add custom CSS from the ‘Misc’ section.
You can now publish your gallery which will make it available to be added anywhere on your WordPress site.
Next, you need to edit a post or page where you want to display your gallery.
On the post edit screen, click on the Add New Block icon and select the Envira Gallery block.
Clicking on it will add the Envira Gallery block in the post editor. Now you can search a gallery by its name or find it by clicking on the dropdown arrow icon.
After that, the plugin will load your gallery in the post editor.
Next, you can review your gallery settings one more time from the block settings panel on the right side.
You can now save your post and preview it to see the gallery on your live website.
Clicking on any image in the gallery will open it in the lightbox popup. You can browse images in the lightbox by pressing the left and right arrow keys on the screen or on your keyboard.
Your gallery will look equally great on mobile as well. Users will be able to tap on an image to enlarge it and swipe to view the next or previous image.
We hope this article helped you learn how to create an image gallery in WordPress. You may also want to see our guide on how to fix common image issues in WordPress.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
WPBeginner Staff says
Are you using any other plugins that might cause conflict? Try deactivating all plugins and see if this fixes the problem.
Catrin Siân Lloyd says
Hi I’m a wordpress beginner! My gallery is somehow linked to the homepage…so when clicked the image takes you back to the ‘Home page’ and not to either a lightbox effect or to the image itself. How do I fix this? Catrin
Michele says
Hi, is it possible to add a lightbox gallery like this in a widget area? Thanks-
Michele
Tyler says
I have a question. I use JQuery plugin for and hovering pin it button. I was wondering if you know of a solution when you click on the photo gallery for carousel mode there is no pin it button. I would I be able to add that button to the gallery?
Diane Lara says
When someone is viewing my gallery of images with minimal captions, when they click on an image, I would like them to see a larger image with additional information about the image beside or below that large image. I don’t want a gallery of images with all of that information destroying the grid aesthetic. Is this possible? I do not know coding or website jargon – sorry.
Imagine That says
This post is so helpful! Many Thanks
Sabrina says
I just have to say, this post is awesome… as all your posts are. You have made me into a better programmer. Thank you for all you do.
Keith Davis says
Hi guys
Just created my first WordPress gallery and carousel – looks fantastic.
Just one question, how do I edit the gallery when I work in html mode not visual mode.
Messed about for half an hour and I can’t figure it out!
Christy says
Thank you SO much for this post. Not only did you save me HOURS of time creating my client’s gallery, you also taught me something new – and I love a good challenge. Your instructions were clear, concise and accurate. You are appreciated!!!
Kailash says
Hi, sayed will it increase the loading time of website ? Beacause i want ot add around 100 photos to my website
WPBeginner Support says
Yes, though it is probably not a good idea to add 100 images even if they are thumbnails, on a single page or post.
Admin
Rita says
This made things so much easier than using a plugin, thanks so much for the article!
I have a question though: is it possible to get rid of the image titles under the images and only show them in the lightbox view? I would like to see only images on the gallery page.
Many thanks,
Rita
Ana Mota says
Thank you so much! You make wordpress very easy for beginners like me. I just have one question:
I have installed the carousel plugin but I don’t want the “write a comment” area to appear. Is there a way to remove it?
Thanks again!
James McInally says
Never knew about the carousel plugin for the WP Gallery, so cheers for that, J
Courtney says
Thanks so much for this page – it was definitely helpful. I did have one question: I’m working on a photography website and trying to apply a gallery to a page; however, I don’t seem to have the option of using the scroller format when I do that, only thumbnails. I’m using PhotoPro, which allows me to have a scroller on the homepage, but my client really wants that format (with different photos) on several pages, and carousel isn’t much of a substitute for the scroller. I’ve tried to find information about this through several sources, but I can’t seem to find a solid answer as to whether or not it’s possible.
vaisakh says
tnkz for your post…..it really helped me…
Gale Weithers says
This post was very very helpful! Thanks a mil!
Marci Hess says
Thanks for this info! I have a couple of questions about the gallery that maybe you can help with.
1) When adding photos, there is an option that I’m unsure about. What is the difference between link to “attachment page or link to “media file”
2) Sometimes my photos get “cut off” in the gallery but are “full size” when you go the hyperlinked page or if you click on that particular photo. I have changed the settings so the media size is the same as what I’m resizing them to, but that didn’t help. What else can I do?
Thanks for any help.
Marci
WPBeginner Support says
1. You can choose to link an image to an attachment page, which is a WordPress page with the image displayed in large size, or you can link to media file, which is the actual image file you uploaded.
2. It looks like cropping is turned on for thumbnail sizes in your WordPress theme. You can turn off cropping to allow WordPress to scale images when resizing them instead of cropping. The problem with this approach is that your images may look disproportionate.
update_option(“thumbnail_crop”, “0”);
Admin
Krish Murali Eswar says
God bless you, folks. Sometimes things are so easy in WordPress. Yet, I miss it. Your site is certainly my first ‘go-to’ site for any wordpress related help.
Robert says
Kudos!! Simple solution for any beginner. Much easier approach that the various lightbox plugin implementations.
Peter says
The images does not show up in IE. Is it a known problem?
Tested IE10 on win7 and win8, same problem.
Great article!
WPBeginner Support says
We are not aware of any such issue. We were unable to reproduce it in internet explorer.
Admin
Dave Lampen says
Is it possible to get rid of the comment box under the gallery?
Francesco says
Awesome !
A question:
Is it possibile link a gallery ?
For example:
PhotoGallery
Is it possibile ? How ?
Thanks and excuse me for my bad english
WPBeginner Support says
Yes it is possible. Lets say you create a post or a page with a photo gallery in it and you title that page PhotoGallery. It is like any other WordPress post or page and can be linked any where.
Admin
Karen says
Awesome! so easy! I’ve spent hours…. trying to get a plugin to do this and it was right under my nose all the time!!!! thank youuuuuuuuuuuu
Marie says
Thank you for explaining this so clearly! I really wish I would have found your site 3 days ago…make that 3 years ago.
Santhi Wijaya says
Hi, is there a way to reduce the opacity of the image border? or to remove completely? Thanks
WPBeginner Support says
Santhi you can override the default gallery CSS in your style sheet
Admin
Keith says
Thanks for a great tutorial. I’m wanting to have my gallery on one side of the page and have it open the album in a carousel next to it in another div. How difficult would that be to do?
Thanks,
Keith
alex says
Hello and thank you for posting this! Do you have any idea why, when clicking on the photos to view them, they are as small as the thumbnails? Thank you!
WPBeginner Support says
One possible could be thumbnail issue with your theme. Try regenerating thumbnails and then create a new post with gallery to see if this resolves your issue
Admin
Lyman says
This is awesome. Exactly what I needed! Thanks for creating it.
Santhi says
Hi, how come when i change the thumbnail size under Settings > Media, the previously uploaded images with old thumbnail size doesn’t change into the new size? Does this mean i have to re-upload those images?
WPBeginner Support says
We have a tutorial on how to add new image sizes in WordPress. Also take a look at how to regenerate thumbnails and new image sizes.
Admin
rachael knight says
Great article, thanks!
Is it possible to keep the captions displayed on the page, instead of only displaying if the user clicks to display the larger img?
Many thanks
Annei says
Can i add this feature on my website without installing the plugin. I mean can i add it manually in theme files?
Editorial Staff says
There is no plugin for this. This is a built-in feature in WordPress.
Admin
Kristen says
Hi there, When I click on a thumbnail of a gallery in my post, it pulls up the gallery carousel but it is off to one side of my screen, like 2 inches on the left so the photos look scrunched up. Do I have something off on my settings?
Daniel says
Thanks!
Zimbrul says
The plugin is particularly good as it’s responsive, I’ll use it on my sites.
I’m currently using a premium plugin that adds social share buttons to the image in a lightbox. It’s pretty good.
One question: if you use the plugin and comment to a photo where the comments shows up? Is like a comment to the article?
Keith says
Zimbrul – Which plugin are you using to add social share buttons to the image in lightbox? Do you have an example you can share? I’m looking for this for a project I’m currently working on.
Thanks,
Keith
Abhijith V M says
Nice information there. Thanks
Carlin says
Good stuff…better than WP’s support pages!
Savannah says
I send you this link to my site-URL.. Will you PLEASE check my galleries?
http://savannahz.wordpress.com/
Savannahz
Editorial Staff says
We don’t provide support for WordPress.com sites. This site is built for those who are using the self-hosted WordPress.
Admin
savannah says
Hi!
When I’m using the Visual Editor I can’t see the box in post edit area indicating that there is gallery code.It used to be there, but something is changed!
Need to know how to fix this!
Sanna
Editorial Staff says
Did you add a new plugin? Because the only thing we can think of with the information provided is that there is a plugin conflict.
Admin
Savannah says
Thanks for the reply!
If I have added a plugin am I not aware of that I did. How can I check if there is any plugin that I should remove??
/ Savannah
Nemo says
Great post! I’ve just been having fun choosing which great gallery mode to have on my blog – the ‘Circles’ option is stunning!! Really professional looking. I had no idea WP had this.
Thanks for posting this HowTo! ;)))))))))))))
Editorial Staff says
Always a pleasure to help
Admin
joseph says
Hello! I THINK this post might be able to help me, but at this point in the day, I am feeling pretty dumb, so… who knows? I have been trying to install a simple slideshow on my WordPress.com blog all afternoon. Literally for the past 5 hours. I have read 8 million supporting pieces, but every time I preview it, I see small thumbnails that open to slightly larger images. If I click on THOSE images, they open into large, individual pictures. I know there is a way to just go straight to large images. I just cannot figure it out. Please, someone, help!
thanks so much in advance.
Editorial Staff says
WordPress.com and self-hosted blogs are different. But WP.com does have a carousel feature that you need to enable.
Admin
Doc4 says
Thank you for this post. I had no idea WordPress even had this fetaure and I’ve been using it for years. I was using the NextGen Galley but this is perfect for a small project I’m working on. Very helpful.
Abdul Rahim says
Very nice and easy tutorial.
I aslo use this plugin to create photo gallery.
Susan says
Hi, When using the Carousel without Jetpack plugin (which works very well, thank you for that!) can you have just one large image on your webpage, which when clicked, opens the carousel gallery as it does in Facebook? I want my webpage to not be a gallery of all the pictures, but rather one image larger.
Any thoughts?
Thanks!
Editorial Staff says
You should use a lightbox plugin for that instead of a carousel. Or you can use the carousel and only add one image in the gallery.
Admin
Susan says
Thanks. I’ll give that a try.
Susan says
Thanks again, adding the one image plus the Carousel worked VERY well for me:
myimmortals.com
Afro Arena says
Thank you very much for your article. With this, I was able to create a beautiful gallery
Willem says
Hi, I wonder what to do about the empty tags being created before and after the gallery. Can you help me out with this?
Kind regards,
Willem
Abbey says
Hey,
I followed your instructions for a site I’m working on but it doesn’t seem to work.
The images are not displayed in a carousel even though the plugin is installed and activated.
Any ideas please?
Editorial Staff says
It is possible that you have another plugin activated that is conflicting with the carousel plugin. Can you please send us an email with your site url, so we can take a look.
Admin
Tanja says
Thank you so much for this! I just made a gallery, it is going to be a visual recipe index for my food blog. Is there a way to add a link to the recipe, when the picture is clicked?
Editorial Staff says
Not unless you manually add that image outside of the gallery and hyperlink it.
Admin
Pamela says
Thank you for this! I was looking for a plugin to make a gallery, I didn’t know you could do this on wordpress directly, I just made a gallery for an article and it looks really good! <3
Rob van den Brand says
Great post, I’ll probably replace NextGen with this option now.
Amar says
How about using nextgen gallery plugin for the same ?
Editorial Staff says
Why use a plugin when WordPress can do the job?
Admin