Docs    Instagram    Documentation

Link Instagram photos to custom URLs

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

Link individual photos to different URLs

There are two methods to do this. You can use our Shoppable Feed feature, or manually change each link.

Shoppable Feed Method (Custom link)

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. Enable the following setting for your feed in our plugin: Instagram Feed > All Feeds > Select your Feed > Settings > Shoppable Feed > Enable. You can then click the Add button on each post to add a custom URL for that specific post. For more detailed directions on creating a shoppable feed, please see this article.

Manual Method

First, disable the plugin’s popup lightbox (Instagram Feed > All Feeds > Feed Options > Customize > Lightbox > Disable)
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.

Linking all photos to the same URL

To do this:
1) First disable the plugin’s popup lightbox (Instagram Feed > All Feeds > Feed Options > Customize > Lightbox > Disable)
2) Add a class to the feed shortcode so that the link is only applied to posts in that feed: [instagram-feed feed=1 class="custom-link-feed"]
3) Add the following Custom JavaScript to your website (Using Custom JavaScript code for our Instagram Feed plugin):

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


Couldn’t find your answer in the docs?

Contact Support

Was this article helpful?