Gallery is one very useful feature of WordPress that is used by many. This feature allows you to showcase your images in a beautifully created gallery format, without using any plugin or any other tweaking. However, you must have noted that when you create a gallery, you can only link those images to either the attachment page or to the media file. This is a limitation of gallery, and we cannot link those gallery images to custom links. That’s why in this tutorial, you will learn how to add custom links to gallery images in WordPress.
By default, you cannot link that gallery picture to any other page, post or website. For many, the two options of linking the image to attachment page or media file are useless. The option of “Custom link” is displayed to a single image outside gallery, but when it comes to gallery, there’s no such option.
Adding Custom Links to Gallery
So you might think that do you need ninja skills to do that? Well, welcome to the world of WordPress plugins where you only need to install a simple plugin and you’re done.
To add custom links functionality to gallery, install and activate the WP Gallery Custom Links plugin.
Edit: WP Gallery Custom Links plugin has been discontinued. Instead, you can use the Gallery Custom Links plugin from here. This plugin is also available in WordPress.org plugin directory, you can just go to Plugins page on your site, search for this plugin and install.
So that’s all you need to do. This plugin doesn’t have any settings page, and you do not need to configure anything. It just starts working when you activate it.
Now, simply go to the page or post and create a new gallery. To create a new gallery, select the images that you want to display in gallery and then click on the “Create a new gallery” button from the bottom right corner. Next, select an individual image and you’ll be able to see a new option for “Gallery Link URL.”
Add the custom link in this field, and it can point to any post, page or any other external website also. For example, as you can see in this screenshot, I have linked the gallery image to beginwp.com.
You also have the option to open the link in a new window, or on the same window. There’s also an option to disable Lightbox and other onclick events if you’ve specified gallery link URL. This will be the default behavior of the plugin.
So go ahead and try out this plugin. It is the simplest ever way to add custom URLs to gallery pictures in WordPress.