Docs    Instagram    FAQs

Can I display photos from a specific hashtag only from a specific user account?

Below version 6.0

You can easily display posts from a User ID that contain certain hashtags by using the setting labeled ‘Show photos containing these words or hashtags’ which can be found in the following location: Instagram Feed > Customize > Moderation.  The plugin will then only show posts that contain those words or hashtags.

You can also specify words or hashtags for individual feeds by using the shortcode option; includewords. For example:

[instagram-feed includewords="#sunshine"]

Below version 2.0

Instagram’s API doesn’t allow you to retrieve photos which include a specific hashtag only from a specific user, they only allow you to retrieve photos for one or the other. We’ve built a workaround for this into version 2.0 of the plugin, and for lower versions you can use the snippet below to achieve similar functionality. The plugin will retrieve photos from your User ID as usual but then the snippet will only show the ones which include the hashtag that you specify. Add the following to the plugin’s Custom JavaScript section, which is on the plugin’s Customize page:

if( $(this).find('.sbi_photo img').attr('alt').toLowerCase().indexOf("#your_hashtag") < 1 ) $(this).remove();

Replace the #your_hashtag with the hashtag you want to display. This will hide all posts from your User ID which don’t include that hashtag.

Alternatively, if the hashtag is pretty unique and used mainly by your Instagram page then it may work better to show all posts from that hashtag and then hide those that aren’t from your page. So you would need to either set the hashtag on the plugin’s Settings page, or use the following shortcode: [instagram-feed type=hashtag hashtag="#your_hashtag"]. You can then use the following JavaScript snippet instead of the previous one to hide all photos which aren’t from your user:

if( $(this).find('.sbi_username a').text() !== "your_username" ) $(this).remove();

Replace your_username with your username (not your User ID).

Please note: as these snippets will only filter through the posts that the plugin retrieves from Instagram then it’s a good idea to set the number of posts to be higher than normal, as some posts will be filtered out.

Technical Support

Still have questions? We are here to help you succeed.

Open a support ticket