Instagram feed showing twice on your website? How to find and remove the duplicate embed code
You open your homepage and the Instagram feed is there twice: two identical grids, one under the other, or one in the content and another in the footer. This is one of the easiest widget problems to fix, because it almost always has the same cause: the embed code is on the page more than once. This post explains why that produces two feeds, how to find every copy in a couple of minutes, where duplicates usually hide on popular platforms, and why a duplicate also doubles the views counted against your plan.
Updated October 12, 2026

The short answer
- Each copy of the embed code draws its own feed. Two copies of the same code on one page give you two identical feeds.
- The second copy is usually somewhere you are not looking: in the theme or template, in a footer or sidebar area, in a site-wide custom code setting, or in a duplicated section.
- Find it with your browser. Search the published page for instagram/widget; every match is one copy of the code.
- Keep one copy, remove the rest, and clear your caches. The remaining copy keeps working with no changes on our side.
- Fix it soon. Every copy that runs counts a view, so a duplicate uses up your monthly views twice as fast.
Why a second copy means a second feed
The Social Feed by grip space embed code is a single script tag. When the browser runs it, the script asks which tag it came from (through a browser feature called document.currentScript), builds the feed, and inserts it directly after that tag. Our post on where to place a widget script explains this in detail.
Each tag does this independently. The widget does not look around the page for other copies of itself and does not try to merge them. That is deliberate: it is what lets you place two different widgets on the same page, for example a grid of recent posts near the top and a slider of Reels further down, and have each one appear where its own tag is.
The side effect is that two copies of the same code are treated exactly like two widgets. The browser runs both, both draw a feed, and both count a view. The fix is always on your site: find the extra copy and remove it.
Same code twice, or two different widgets?
Before you start deleting, check which situation you are in. They look similar on screen but need different fixes.
| What you see | Likely situation | What to do |
|---|---|---|
| Two feeds that are identical in every detail: same posts, same layout, same header | The same embed code is on the page twice | Find both copies and remove one |
| Two feeds with the same posts but a different layout, number of posts or filters | Two different widgets from your account, both placed on the page | Decide whether you want both; if not, remove the code of the one you do not want |
| Two feeds that look completely different, such as one with a different style or credit line | One is ours and the other comes from another plugin, app or Instagram tool | Remove the old tool, or its block, from your site |
| Only one feed is visible, but the view count is about double what you expected | A second copy is on the page but hidden, often in a mobile-only or desktop-only section | Find the hidden copy; it still runs and counts |
Each widget you create in Social Feed has its own embed code, and the last part of the address in the src attribute is different for every widget. Comparing that part of the address is the quickest way to tell “the same widget twice” from “two different widgets”.
Find every copy in two minutes
Do this on the published page, not in your editor. Many editors show their own preview and do not run scripts the same way. Open the page in a private window so you are not looking at a cached or logged-in version.
- Open the page in Chrome, Edge or Firefox, right-click on one of the feeds and choose Inspect.
- In the Elements (or Inspector) panel, press Command+F on a Mac or Control+F on Windows and search for instagram/widget.
- The search box shows how many matches there are. Each match is one script tag. Step through them and note where each one sits: inside the main content, in a footer, in a sidebar, at the end of the body.
- Directly after each tag you should see a div with the class grip-ig-widget. That div is the feed drawn by that tag.
- Compare the src address of each match. If they are identical, you have the same widget twice. If they differ, they are different widgets.
If you prefer, paste this into the Console panel of the same page. It lists every widget script tag with its address and the element it sits in, and counts the feeds that were drawn:
// Paste into the browser console on the published page
var tags = document.querySelectorAll('script[src*="instagram/widget"]');
console.log('Widget script tags:', tags.length);
tags.forEach(function (s, i) {
console.log(i + 1, s.src, s.parentElement);
});
console.log('Feeds drawn:', document.querySelectorAll('.grip-ig-widget').length);Two tags and two feeds confirm a duplicate in the HTML. If the console shows one tag but two feeds, or the number of feeds goes up when you navigate around the site without reloading, your site is probably a single-page app; see the section on JavaScript frameworks below.
Where the second copy usually hides
Once you know there are two copies, the question is where the one you did not mean to add came from. These are the places we see most often, roughly in order.
1. In the theme or template and in the page itself
This is the classic case. At some point the code was added to a template that every page (or every page of one type) uses, for example a homepage template or a theme file. Later, someone added it again to the page content with an embed or HTML block, because they could not see it in the page editor. The page now gets one copy from the template and one from the content.
It also happens the other way around: the feed was first added to one page, then someone decided to show it on every page and added it to the template, forgetting to remove the first copy. That page now shows two, while every other page shows one. If only one page has the problem, this is the first thing to check.
The fix is to decide where the feed belongs. If it should appear on one page only, keep it in that page’s content and remove it from the template. If it should appear everywhere, keep it in the template and remove the page copy.
2. In a footer or sidebar area and in the page content
Feeds in the footer are popular, and most themes let you add custom HTML to a footer or sidebar area that appears on every page. If the same code is also in the content of a page, that page shows the feed twice: once where you placed it and once in the footer. Our post on an Instagram feed in your website footer covers how to set up a footer feed properly.
If you want both, for example a large grid on the homepage and a small strip in the footer of every page, use two different widgets with settings suited to each spot. If you only want one, remove the copy from either the footer area or the page.
3. In a site-wide custom code setting
Most website builders and many themes have a setting for code that is added to every page, usually split into “head” and “body” or “header” and “footer” code. These settings are meant for page-wide scripts such as analytics. If the feed code was pasted there, it runs on every page and draws a feed at the very start or the very end of the body, depending on the setting. Add the same code to a page with an embed block and that page shows two.
A copy in the head draws a feed you never see, because browsers do not display the head, but it still runs and counts a view on every page. That is one reason we recommend never pasting the code into head settings. The widget script placement post has a table of what happens in each position.
4. A duplicated page, section or reusable block
Copying a page or section is a fast way to build a site, and the copy takes the embed code with it. Common versions of this:
- A page was duplicated to make a new page, and the new page already had the feed. Someone then added the feed again.
- A section containing the feed was duplicated while rearranging the page, and the copy stayed in place, perhaps far down the page.
- The feed is inside a reusable block, global section or symbol that appears on the page, and the page also has its own copy.
- The page has separate sections for mobile and desktop, and both contain the code. One of them is hidden with CSS on each screen size.
The last case is worth a closer look. A section that is hidden with CSS is still part of the page. The browser runs its script, the feed is drawn inside the hidden section, and a view is counted, even though nobody can see it. Visitors only ever see one feed, so the duplicate goes unnoticed, and the only symptom is a view count that is higher than you expected.
5. The code was pasted twice into the same block
It sounds too simple, but it is common: someone copied the embed code again, clicked into the existing HTML block and pasted it without first deleting what was there. The block now contains two script tags, one after the other, and the page shows two feeds back to back. Open the block and check that it contains exactly one script tag.
6. An old Instagram plugin or app is still installed
If the two feeds look different, one of them is probably not ours. Sites that switched from another Instagram feed tool, or from an old plugin that stopped working, sometimes still have the old tool’s block or shortcode on the page. Remove the old tool’s block or shortcode, and uninstall the tool if you no longer need it. If you are moving from another plugin, our Smash Balloon alternative post walks through the switch.
7. A tag manager also loads the code
If the code was added to a tag manager at some point, perhaps while testing, and later also pasted into the page, the page runs both. The tag manager copy usually draws its feed wherever the tag manager inserts its tags, which is often the end of the page. Remove the tag from the tag manager and publish the container.
8. The site is a single-page app
Sites built with React, Next.js, Vue, Nuxt, Angular and similar frameworks often change pages without a full reload. If the code that adds the feed runs every time a page or component appears, and nothing removes the previous feed, you can get two feeds after navigating away and back, or two in development because the framework mounts components twice to test them. The HTML of your source files contains the code only once, which makes this confusing. Our post on adding the Instagram widget to React, Next.js and Vue shows a safe pattern that cleans up after itself.
Platform by platform: where to look
Menu names change over time, so use these as pointers to the kind of place to check, and our step-by-step guides for the exact spot where the feed should go.
| Platform | Where duplicates usually come from | Our guide |
|---|---|---|
| WordPress | A Custom HTML block in the page plus a copy in a widget area (footer or sidebar), a theme file, a site-wide code plugin, or an old Instagram plugin’s block or shortcode | WordPress guide |
| Shopify | A Custom Liquid section on a page template plus a copy in the theme code or another section; sections duplicated in the theme editor | Shopify guide |
| Wix | An Embed HTML element on the page plus another set to appear on all pages, or a copy in the site-wide custom code settings | Wix guide |
| Squarespace | A Code block on the page plus a copy in site-wide code injection, or a duplicated section | Squarespace guide |
| Webflow | A Code Embed element on the page plus a copy in a symbol or component used on that page, or in the site’s custom code settings | Webflow guide |
| Plain HTML | A copy in a shared header or footer include plus one in the page file | HTML guide |
Why a duplicate doubles your views
Every time the embed script runs on a page, the widget sends one view to our servers. Known bots and crawlers are not counted. Two copies on a page mean two views for every page load, even if one copy is hidden or sits in the head where nobody sees it.
| Situation | Views per page load |
|---|---|
| One copy of the code on the page | 1 |
| The same code twice on the page | 2 |
| The code in the footer area of every page plus once in the homepage content | 2 on the homepage, 1 on every other page |
| The code in a site-wide head setting plus once in a page | 2 on that page, 1 on every other page, even though no feed is visible on those pages |
| A visible copy plus a copy in a hidden mobile or desktop section | 2 |
Views are counted per month across all widgets in your account, against your plan’s allowance:
| Plan | Views per month |
|---|---|
| Free | 3,000 |
| Light | 30,000 |
| Standard | Unlimited |
Going over the allowance for a single month does not switch your feed off. If you go over it two months in a row, the widget stops displaying from the following month until you are back within the allowance or move to a higher plan. A duplicate that quietly doubles your views can be what pushes a site over that line, so it is worth fixing even if the second feed is hidden. See the pricing section for the plans.
Your dashboard shows a view count and a chart for each widget. A sudden jump to about twice the usual level, starting on the day someone edited the site, is a strong sign that a copy was added. If you have several widgets, the chart also shows which widget is affected, which narrows down where to look.
Removing the duplicate safely
- Decide which copy to keep. Keep the one that is in the place you want the feed to appear. For a feed on one page, that is usually the copy in the page content. For a feed on every page, it is the copy in the footer or template.
- Remove the other copies completely. Delete the whole script tag, from the opening <script to the closing </script>. Do not leave half a tag behind; a broken fragment can show up as text on the page.
- Save and publish. Many builders keep changes in a draft until you publish.
- Clear every cache. That includes your platform or caching plugin, any CDN in front of your site, and your browser. A cached copy of the old page can still show two feeds after the fix.
- Check again in a private window, on a phone and on a computer, and repeat the instagram/widget search. You should find exactly one match per feed you want.
You do not need to change anything in your Social Feed dashboard. The widget, its settings and its embed code stay the same; you are only removing the extra copy from your site.
When you actually want two feeds on one page
Sometimes two feeds on a page is the goal: a full grid in the main content and a short slider in a sidebar, or one feed of Reels and one of photos. In that case, create a second widget instead of pasting the same code twice. Duplicate the first widget so it starts with the same settings, then change only what should differ. Each widget gets its own embed code, and each feed appears where its own tag is. Our post on multiple Instagram feeds on one website covers this, including how many widgets each plan allows.
Troubleshooting
I removed one copy and now both feeds are gone. Either both feeds were drawn by the copy you removed (for example, a block with two tags inside it, which you deleted entirely), or the remaining copy is in a spot that is not displayed, such as the head. Search the page for instagram/widget again. If there are no matches, paste the code once into the place where the feed should appear.
I removed the duplicate but still see two feeds. You are most likely looking at a cached page. Clear your caching plugin, CDN and browser cache, then check in a private window. If the search still finds two tags, there was a third copy.
The search finds one tag, but I see two feeds. Something is running the script more than once. This is usually a single-page app or a page builder that re-inserts content. Note whether the second feed appears after navigating within the site, and see the React, Next.js and Vue post.
The second feed is at the very bottom of the page, below the footer. One copy is in an end-of-body setting, a tag manager, or an optimization tool that moves scripts to the end of the page. Remove it from there, or exclude the script from the optimizer.
Only one feed is visible, but the views are double what I expected. Look for a copy in the head or in a hidden section. The Console snippet above counts every tag and feed, visible or not.
Frequently asked questions
Can the widget detect and skip a second copy of itself? No. Each tag draws its own feed, which is what allows different widgets on the same page. Removing the extra copy is the fix.
Is a hidden copy counted? Yes. If the script runs, a view is counted, whether the feed is visible, hidden with CSS, or drawn into the head.
Will removing a copy reset my settings? No. Settings are stored with the widget in your Social Feed account, not in the embed code on your page.
The feed is not showing at all, not even once. That is a different problem with its own causes. See Instagram feed not showing on your website.
New to Social Feed? Create a free account to get your embed code. For reference, a correct embed is a single tag like this, pasted once where the feed should appear:
<script type="text/javascript" src="https://n246.grip.space/api/v1/instagram/widget/xxxxxxxx"></script>Sources
- MDN Web Docs, “Document: currentScript property”: https://developer.mozilla.org/en-US/docs/Web/API/Document/currentScript
- React documentation, “Synchronizing with Effects” (components mounted twice in development): https://react.dev/learn/synchronizing-with-effects
Get your embed code in a few minutes. The Free plan needs no credit card.
Sign up freeMore articles

How to add an Instagram feed widget to a React, Next.js or Vue site
Script tags in JSX or innerHTML don’t run in React, Next.js or Vue. A tested pattern for adding an in-place Instagram widget, with cleanup and the caveats.
Read the article →
Instagram widget in the wrong language? How page language is detected
Why your Instagram feed widget shows Japanese (or English) text, how it reads your page’s lang attribute, and how to fix it on WordPress, Wix and more.
Read the article →
How to add an Instagram feed to Google Sites
Add an auto-updating Instagram feed to Google Sites with Insert > Embed > Embed code: steps, sizing the embed box, lightbox limits and fixes.
Read the article →
Instagram API rate limits: why feed tools cache your posts
What Meta’s Instagram API rate limits say, what happens when an app hits them, and exactly when Social Feed by grip space reads your posts from Instagram.
Read the article →
What an Instagram feed can (and can’t) show via the API
Which Instagram data a website feed can get through Meta’s API, field by field: posts, captions, like and comment counts, and why Stories and tags are out.
Read the article →
Can you embed Instagram Stories or Highlights on your website?
An honest answer from Meta’s docs: Instagram’s embed tool doesn’t support Stories, the API limits them to 24 hours, and Highlights have no endpoint.
Read the article →