Gallery Custom Links


Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others. The official page is here: Gallery Custom Links.


Two fields are added to your images, in your Media Library: Link URL and Link Target. If, at least, the Link URL is set up, this image will link to that URL every time it is used within a gallery. Lightbox will be automatically disabled for those images.


It currently works with the native WP Gallery, the Gutenberg Gallery, and the Meow Gallery. It should actually work with any gallery plugin using the ‘gallery’ class and Responsive Images (src-set). Let me know if you would like more galleries to be supported, it should be easy.


You can optimize (run the plugin only on the pages where you need it) and support more galleries (through CSS classes) easily by using filters. To know more about this, visit the official page, here: Gallery Custom Links.


The motivation to build this plugin came from my users who had issues trying to use WP Gallery Custom Links. I realized that this plugin was working extremely well with the standard gallery, but would require too much rewriting for Gutenberg and other galleries, hence the creation of this plugin. I hope it will help.

Languages: English.

Imagens de tela

  • The fields.


  1. Upload gallery-custom-links to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress


julho 2, 2019
I can't beleive this isn't a part of wordpress core. The whole Gallery aspect of Gutenberg is a nice begining but its a shame basic things you would expect like this and lightbox to be included as standard. Anyway simple set up, lightweight plugin and it worked fine for me running WordPress 5.2.2.
maio 11, 2019
I have tested this in the built-in Gutenberg gallery that comes with wordpress and whenever a photo has a caption the link is ignored and the photo comes up. If I remove the caption it will work as expected taking me to the link I wanted. Anyone else is having this issue? could it be fixed? Otherwise an excellent plugin, but this small issue is a big one for me. Thanks!!!
maio 5, 2019
My 600 links in five different galleries transferred over perfectly. Kimberly Laurel nailed the description and instructions below at the comment "Seamless Conversion from WP Gallery Custom Links". Thank you, Kimberly for logging in here to confirm this great news and THANK YOU, Jordy Meow for your brilliant creation to replace WP Gallery Custom Links.
abril 21, 2019
I've been googling "how to add external urls to gallery images" and trying different pieces of code, then stumbled upon this neat plugin. It does what it says, and it does it well. Excellent that I get to choose if the links open in page or in a new page and the choice of follow / no follow is good. Love that it works with other galleries from WordPress Gallery, Gutenberg, Meow Gallery and others - you've nothing to lose by trying it 🙂
abril 16, 2019
I am soooo happy with this plugin! It's a must for every blogger who wants to make money with affiliate links. This is a nice way to immigrate these links in blogpostst. Just love it!! And when I asked if the links could be no-follow, the developer helped me almost instantely. A big YESSS for this plugin.
junho 3, 2019
Migrated seamlessly from the old WP Gallery Custom Links plugin - I followed the direction in another review - installed and activated this one before deactivating and deleting the old one. Everything transferred beautifully 🙂 🙂 I wish every plugin migration could go as seamlessly as this! (BTW, WordPress did, slightly alarmingly, say it was going to delete the old plugin *and its data* but I guess this plugin had taken ownership of that data, so nothing lost... phew!) UPDATE: I did end up with one minor migration issue - Jordy engaged immediately and helpfully, and between us we resolved it. If you have any issues with migrating Galleries with some linked and some unlinked images, see this thread. And once again, huge thanks to Jordy - I wish every developer responded as quickly and helpfully as this! 🙂 🙂
Leia todas as 34 avaliações

Contribuidores e desenvolvedores

“Gallery Custom Links” é um software com código aberto. As seguintes pessoas contribuíram para este plugin.


“Gallery Custom Links” foi traduzido para 2 localidades. Obrigado aos tradutores por suas contribuições.

Traduzir “Gallery Custom Links” para o seu idioma.

Interessado no desenvolvimento?

Navegue pelo código, dê uma olhada no repositório SVN ou assine o registro de desenvolvimento via RSS.

Registro de alterações


  • Fix: Simpler and probably better REST detection.
  • Info: If you like the plugin, your reviews are welcome here 🙂 Thank you!


  • Fix: Attempt to fix the way autoload is working.


  • Fix: Avoid analyzing the html content if the parser returned a boolean or an empty string.


  • Add: Rel can now be set to nofollow.


  • Update: Defaults set to Output Buffering + HtmlDomParser. Those settings work for most.


  • Update: Using HtmlDomParser fully (which should avoid broken HTML). It is possible to override the plugin hidden options to switch to different mode, but I am trying to find a mode that works for 99% of the users first.


  • Update: Avoid interfering at all with all Ajax/Rest requests.
  • Info: Sorry for the last bunch of updates, some way of modifying HTML works for some, and not for others, and I am still trying to find a solution which works for everyone.


  • Update: Back to OB, maybe there should be an option for that.
  • Update: Get all the images of the page/post content instead of within specific containers previously.


  • Update: Not using OB anymore; going through the content filter (this behavior can be changed internally), better and faster this way.
  • Fix: Avoid issues with static variables which are not registered on older PHP versions.


  • Fix: Now works with the most tenacious lightboxes.
  • Update: The way the HTML was modified to make sure it is compliant.


  • Add: Filter to let the user enables/disables the plugin depending on conditions. Check the official page to know more about this: Gallery Custom Links.


  • Fix: Support images embedded in a few layer of tags before the link tag.
  • Add: Added a class on the a-tag, for the ones who would like to add some styling to linked images. The Meow Lightbox is already handling this, by avoiding showing a zoom cursor when hovering images.
  • Add: Compatibility with extra galleries is made through a filter (which anybody can use) and the file mgcl_extra.php.
  • Info: If you like the plugin, your reviews are welcome here 🙂 Thank you!


  • Fix: Now works with thumbnails in src.
  • Update: Optimization (does not regenerate pages which aren’t impacted by changes).
  • Update: DiDom from 1.13 to 1.14.1.


  • Update: If the ID of the Media is not found in the HTML, it will resolve it through the DB from the filename.


  • First release.