If your Squarespace page jumps the moment your Instagram feed appears on a phone, you are looking at instagram feed embed layout shift on Squarespace mobile, and it is usually caused by one of three things: the feed container has no reserved height, the post images have no intrinsic dimensions, or the WidgetJar embed script loads later than the Squarespace section wrapper expects it to. This guide walks through a mobile-only diagnostic and fix that keeps the feed on the page and keeps your section heights intact.
First, a definition. Cumulative Layout Shift (CLS) scores unexpected movement of visible content during the page's life. You want it low, and a feed that pops in above the fold is a classic offender. Only movement the visitor did not trigger counts, so a user opening a carousel tile is not penalised, but the grid above their thumb suddenly shifting is.
Before you change a single block, capture what is actually happening.
Step 1: Capture a mobile-only CLS and LCP baseline
Desktop is not the problem here. Squarespace mobile templates stack sections, which changes both the width available to the feed and the order in which content renders. Measure at a phone width or you will tune the wrong thing.
- Open the live page in Chrome DevTools, switch Device mode on, and pick a common phone viewport (for example 390 x 844). Apply no network throttling for the first pass, then repeat with Fast 3G so you can see the late-loading feed.
- Open the Performance panel, enable the Layout Shift regions option, and record a full load plus a two-second settle.
- Note two numbers: your good baseline CLS from the Experience section, and the LCP element. The LCP element might be a hero image or heading above the feed, but the feed's shift can still delay it. Frame data on real users is worth reading before you trust a single lab run, and the way CrUX and lab data differ is explained in Google's guide to optimizing Largest Contentful Paint.
- Cross-check with PageSpeed Insights on the mobile tab. If CrUX data exists for the URL, treat the field numbers as the truth and the Lighthouse numbers as a hint.
Write the baseline down: date, viewport, throttle setting, CLS, LCP, and the LCP element. A before/after comparison with no recorded baseline is not a fix, it is an opinion. If you want a longer treatment of the measurement method, our widget loading performance before/after benchmark guide walks through the same harness.
Step 2: Find which element moves
With Layout Shift regions enabled, reload and watch the purple flashes. You are looking for one of three culprits:
- The feed container itself. The whole block appears below where it should be, pushing later sections down. This is the most common case and the easiest to fix.
- Images inside the feed. Tiles render as zero-height placeholders and then expand. Here the container exists but each tile collapses.
- A Squarespace section wrapper. The feed renders correctly, but the section around it grows after the embed runs because Squarespace recalculates its own height.
Click each shift entry in the Performance trace. DevTools names the shifted element, which removes the guesswork. If the shifted node is a Squarespace wrapper, note it; you will deal with it separately in Step 3 rather than by adjusting the widget alone.
Step 3: Reserve the feed box with an explicit aspect-ratio
The core fix is to give the feed a box with a defined shape before anything renders into it. Browsers can compute an aspect ratio from declared intrinsic dimensions before a resource loads, which is exactly the mechanism that prevents this reflow: MDN's reference on the img HTML element notes that including height and width enables the aspect ratio to be calculated prior to the image loading, reducing or even preventing layout shift.
On Squarespace, add a Code Block or use your site's custom CSS to wrap the feed target in a container like this:
.ig-feed-wrap {
aspect-ratio: 1 / 1; /* match your grid shape */
width: 100%;
max-width: 100%;
overflow: hidden;
contain: layout paint;
}
@media (max-width: 767px) {
.ig-feed-wrap {
aspect-ratio: 3 / 4; /* taller on phones if your grid stacks */
}
}
Two things to verify before you move on:
- The widget still renders inside the wrapper; some feeds expect to size themselves against the viewport.
- Squarespace's section height does not collapse to zero or stretch beyond the wrapper. Check the section in the editor and in an incognito window, because a logged-in editor view can cache styles differently.
If the wrapper forces the feed into a scroll box, the aspect ratio is too tight for the number of posts you show. Either raise the ratio or reduce the post count.
Step 4: Control image sizing inside the feed
A reserved outer box does not help if each tile is still unpredictable. Once you have per-image intrinsic dimensions, the browser can allocate the correct space for every tile, including lazy-loaded ones. This matters even more for deferred images, because unloaded images have no dimensions of their own until attributes supply them, so the shift happens right as the reader scrolls into the feed.
In WidgetJar's feed settings, where available, set the rendered image dimensions or a fixed tile ratio, and apply object-fit: cover so a portrait post does not stretch a square tile. Then confirm in DevTools that each img in the rendered feed carries width and height attributes. If your template's CSS strips them, the container from Step 3 is doing the heavy lifting; if it does not, the attributes are the second line of defence.
This also protects accessibility. Images that jump in size are hard for keyboard and screen reader users to follow, and alt text decisions are covered in our guide to Instagram feed alt text and captions accessibility.
Step 5: Install the WidgetJar embed without blocking first paint
Widget is configured in the WidgetJar panel and installed by placing the embed script on your registered Squarespace domain. The goal is to load that script after the page's own critical content rather than before it.
- Place the embed script in a Code Block or footer injection point rather than in the head where possible.
- If your plan or template lets you, add
deferto the script tag so it executes after HTML parsing without holding up the first render. - Check ordering against Squarespace's own scripts. A Squarespace section script that measures height on load can run before the widget exists, then resize once the feed appears. If that happens, fix the wrapper (Step 3) rather than fighting the order.
To see how the same deferral logic works on another platform, our embed Google Reviews widget on Squarespace walkthrough covers install and verification on the same CMS. If CLS is still troublesome after deferral, a click-to-load approach is the heavier option; the click-to-load facade performance guide explains when that extra step pays off for LCP as well as CLS.
Step 6: Re-test on a real phone
Device mode is a simulation; a phone is not. Open the live URL on an actual handset over mobile data, and:
- Repeat the DevTools-style check via remote debugging if you can, or use PageSpeed Insights' mobile field data if available.
- Confirm the feed still renders, tiles are sized correctly, and the section below it does not move.
- Scroll the feed on the phone and check the carousel or grid responds without extra reflow.
- Rotate to landscape and back; note whether the aspect-ratio change produces an extra shift.
Compare your numbers to the baseline. A meaningful improvement is a CLS drop with the same or better LCP, not a CLS drop achieved by hiding the feed.
Pre-launch checklist and false fixes
- Feed wrapper has an explicit aspect-ratio at mobile and desktop widths.
- Post images carry intrinsic width and height attributes or a fixed tile ratio.
- The embed script is deferred and not in the critical head path.
- Squarespace section height matches the wrapper after load and after scroll.
- Baseline and after numbers recorded with viewport and throttle settings.
- Feed still readable and keyboard-navigable after the change.
Watch for these false fixes: setting the wrapper to display: none until load (which hides the shift but delays content and may harm discovery), collapsing the section height to zero, or removing the feed entirely. None of those solve the visitor's experience.
When the shift persists
If the trace still shows a Squarespace wrapper resizing after your changes, log the exact shifted node, its computed height before and after load, the viewport, and whether an editor session replicates it. Then bring that to support along with your before/after CLS readings so they can see whether the issue sits in the embed or the template.
Ready to configure the feed so it reserves its own space and behaves on mobile? Set up your Instagram feed widget in WidgetJar, install the embed script on your registered domain, and re-run the checklist above before you publish.