How to Add Custom Hyperlinks to Your WordPress Gallery Images

Learn how to add custom hyperlinks to your WordPress gallery images. First, let’s look at what custom links are and why you may want to consider them.

This tutorial looks at the benefits of WordPress gallery images with custom links:

  1. What is a WordPress gallery?
  2. What are custom links?
  3. Why bother with custom links?
  4. How to apply custom links to WP gallery images

#1 What is a WordPress gallery?

A WordPress gallery is a collection of select images or other media. They help to bring a post or page to life by adding easy-to-navigate visual content. These images complement the written text by helping to tell a story or showcase a portfolio of products. Online tutors also use gallery images to guide readers with step-by-step instructions.

#2 What are WP gallery custom links?

The default link choice is limited when you create a gallery in WordPress. You can only link to the image’s attachment page or media file. Custom gallery links give you more control over where or what you can link the gallery images to. That means you can add any URL you like. This guide shows you how to override the WordPress gallery link restrictions.

#3 Why Use custom links?

Custom links give you more control over site navigation. You can link photos or illustrations that take the users to new posts or pages about the image. An example could be a post gallery that displays types of dog breeds. Custom image links could take visitors to in-depth pages about specific animals. They’re also perfect for products, food recipes, and many other things.

Images are more captivating and visually pleasing than simple text links. Well-organized galleries are simple, intuitive, and don’t need additional text. 

#4 How to apply custom links to gallery images

The best way to exploit custom links for WordPress galleries is to use a plugin. Please install and activate the free Gallery Custom Links plugin By Jordy Meow.

This guide assumes you’re familiar with installing and activating plugins from your Admin area. If not, read How to Install New Plugins in WordPress before continuing.

Tip. Always check a plugin’s compatibility with your version of WordPress before installation.

Adding Custom Gallery Links in WordPress

This tutorial assumes you’ve already installed and activated the plugin above. There are no settings to configure. The plugin adds extra fields to your Media Library Attachment Details area on the right of the screen. These fields are where you attach your custom links to image files.

If you’re creating a new article, go to Posts => Add New from the side menu, or …

Go to Posts => All Posts if you’re editing an existing piece.

To open an existing post, click its Edit link.

  1. From your Post Edit screen, click on the Add Block symbol (+) button
  2. Click the Gallery block from the options box

You’re now presented with a Gallery options box.

Click Upload if your gallery images are not in the WordPress Media library yet. If you’ve uploaded them already, click the Media Library button.

Now click the Create Gallery link in the left-side column.

  1. Select the images for your gallery
  2. Scroll to the end of the Attachment Details column (right)
  3. Enter the custom link URL
  4. Choose a link target from the Link Target dropdown
  5. Click the blue Create a New Gallery button to update the changes

Custom link options

The Link URL can be an internal link. That means it can point to any other post or page on your WordPress blog or Website. You can also put an external link in this box and link to anywhere you like on the internet.

Preview the changes and save the post or page if you’re happy with the results.

Adding Custom Links to Individual Images

These steps are almost the same as adding links to a collection of images. The only difference is that you choose an Image block instead of a gallery block from the Post Edit screen.

  1. From your Post Edit screen, click on the Add Block symbol (+)
  2. Click the Image block from the block options box

You can upload new images, add an image URL, or go straight to the Media library.

  1. Select an image from your gallery
  2. Enter the custom Link URL from the Attachment Details column (right)
  3. Choose a link target from the Link Target dropdown
  4. Click the blue Select button

Preview the changes and save the post or page if you’re happy with the results.

Closing Comments

Gallery images attract visitor eyeballs to your WordPress post or page. Moreover, visitors to your site are more likely to click on images than boring text links. The custom links feature gives authors more control over content and site navigation overall. It’s an approach that improves both personal and commercial websites and those who visit them.

Want to Learn WordPress?

WordPress is an amazing platform for building any type of website.   It’s used by large corporations and small mom & pop sites.

You may also like


Leave a Comment

Your email address will not be published. Required fields are marked *

Hello, I'm
Andy Williams!

You can get up to 90% off my Online Courses for webmasters, marketers & affiliates (plus a free course on Gutenberg).

Create your own WordPress Theme

It's built in to WordPress using Gutenberg, and my new course shows you how.