Docs    Instagram    Documentation

Link Instagram photos to custom URLs

By default, the photos in the Instagram Feed will link to the photos on Instagram, however, you can use custom code snippets to link each photo to a unique URL of your choosing.


Linking all photos to the same URL

To do this:
1) First disable the plugin’s popup lightbox (Instagram Feed > Customize > Photos > Disable Pop-up Lightbox)
2) Add a class to the feed shortcode so that the link is only applied to posts in that feed: [instagram-feed class="custom-link-feed"]
3) Add the following to the plugin’s Custom JavaScript section (Instagram Feed > Customize > Misc):

$('.custom-link-feed .sbi_photo').attr('href', '');


Link individual photos to different URLs

There are two methods to do this. You can manually change each link, or if you can add the full URL to the caption of your Instagram posts (on then you can automatically make that post link to the page in the caption.

Manual Method

First, disable the plugin’s popup lightbox (Instagram Feed > Customize > Photos > Disable Pop-up Lightbox)
Then you need to find the ID of each photo. You can do this by right clicking on the photo, clicking “Inspect Element” and then making copying the ID attribute (screenshot). It will look similar to this: sbi_1253736523657580376_10145706.

In the Pro version you can also find the ID by viewing your feed, clicking on the photo to launch the popup lightbox, and then clicking on the ‘Hide Photos (admin)’ link.

You can then use a JavaScript snippet to change the link on each photo, like so:

$('#sbi_1253736523657580376').find('.sbi_photo').attr('href', '');
$('#sbi_1253665037575982435').find('.sbi_photo').attr('href', '');
$('#sbi_1248694870995570598').find('.sbi_photo').attr('href', '');

You can add these to the plugin’s Custom JavaScript section on the Customize page.


Full Link URL in Caption Method

Note: This feature is only available in the “Pro” version.

We’ve added a feature to the Pro version of the plugin to make linking your posts to custom URLs really easy and painless. Simply add the URL you’d like to link the post to in the caption of the post on Instagram. Then enable the following setting in our plugin: Instagram Feed > Customize > Link posts to URL to caption. For more detailed directions on creating a shoppable feed, please see this article.


Couldn’t find your answer in the docs?

Contact Support