Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Add Custom Links to Gallery Images in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Add Custom Links to Gallery Images in WordPress

When adding an image in WordPress, you can make it so it links to a specific page. However when you are creating a gallery, your choices are either to link the image to the attachment page or the media file. In this article, we will show you how to add custom links to gallery images in WordPress.

First, let’s take a look at how to add a custom link to a single image in WordPress. You would upload your image file using the media uploader. Once it is uploaded, you can link it to a custom URL under attachment display settings.

Adding custom link to a single image in WordPress

Simple wasn’t it? But this setting is not available when you are creating a gallery in WordPress. You can link a gallery image to either attachment page or media file, but you can not add custom links to individual images in gallery.

Adding Custom Links to Gallery Images

To add gallery custom links functionality to gallery images in WordPress, all you need to do is install and activate WP Gallery Custom Links plugin.

It works out of the box, so there are no settings for you to configure. Simply go to a post or page and create a new gallery. You will see the custom link meta fields for individual images in gallery.

Adding custom link to gallery images in WordPress

You can link an image in the gallery to any post, page, or even an external website. You can also choose whether you would like the link to open in the same or a new window.

The plugin works very well with any other plugins you may be using to display images in lightbox popup or carousel. It also allows you to keep or disable onclick events for an individual image in the gallery.

We hope this article helped you add custom links to gallery images in WordPress. For other images related problems, check out our guide on how to fix common image issues in WordPress.

For feedback and questions, please leave a comment below.


Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Steve says:

    Does this plugin still work?
    I installed it and can’t get any of the images in my gallery to be clickable. I’ve been playing around with it and trying different options but no luck. It would be a brilliant plugin if I could get it to work..

    Thanks!

    • Steve says:

      Nevermind. I finally got it working when I switched the general setting to link to “media file”.
      Thanks!

  2. Srinimf says:

    Really good site

  3. Axel says:

    Thanks for the tip, it was exactly what I needed.

    Keep up the good work.

  4. Neel says:

    Can anybody help making the WordPress Gallery responsive??

  5. Mudasir says:

    I want have uploaded an image in my site which ontain a link I want to made that link no follow but i click on the no follow button its says no hyperlink. What should I do

  6. Steve Denger says:

    That is so cool! You guys always have the answers and I value your site!

  7. Adrian says:

    I had the same problem as ‘K’ (who posted on Jun 6, 2015 at 12:53 pm) – took a while to workout but you need the full address (including http:// ) to get external links to work correctly.

    Very helpful pluggin.

  8. K says:

    When I type in the url I would like the image to link to everything works except the URL of the linked page just gets tagged to the end of MY pages URL and therefore gets a mistake message saying that the url doesnt exist (because it’s now two URLs stacked) Please help! Would love this to work!

  9. twifordmin says:

    Will this enable me to post an image on Facebook so that when people click on the image it takes them to a post in WordPress?

  10. WPBeginner Staff says:

    Style, you will need to adjust the padding and margins in your theme’s stylesheet.

  11. Ali Khan says:

    Nice Info. How can we wrap text around the images without corners of the images protruding out of the text alignment ? Is it the width of the page or something to do with the style. ?

  12. Doreen Sargente says:

    Are there any tutorials on how to use this plug in with the newest version of WP? I’ve been happily using it for nearly a year but since upgrading I haven’t been able to figure it out and can’t find much help on how to do it.

  13. Amanda Lucas says:

    Thanks so much – been searching for a solution for my food blog

  14. Andrew says:

    Thanks, this was killing me for a bit…:)

  15. payam says:

    thanks

  16. Livi says:

    Love it. Thank you!!

  17. aayush says:

    Hi there i am using this plugin. can you tell me that how can i set all images size same whatever i want set the size of all the images of my gallery. here is my website

    please see all the images size. i want to keep all the images size same. can you help me with that if you can please reply. i would really appreciate your help. thanks

  18. Elisa says:

    Great timing as I was just finally getting to wanting to add links to images in a client gallery.
    Thank you!

  19. Jill says:

    Thanks for the info! Do you know if there’s any way to make the WP gallery links “nofollow”?

    • WPBeginner Support says:

      This is not possible at this moment without editing the plugin itself, which we do not recommend. However if you feel comfortable creating your own plugins then you can fork the plugin and modify it to match your needs.

  20. karen says:

    An excellent bit of information. Many thanks!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.