Shopify speed optimization in 2026 means fixing three things that almost every slow store shares: render-blocking app scripts, unoptimized hero and product images, and JavaScript loaded on pages that do not need it. This guide walks through each lever — with Liquid code, app audit steps, and a prioritized checklist you can run this week.
Shopify hosts your assets on a fast CDN, but the platform cannot fix a theme that loads twelve third-party scripts before the first product image paints. That is why LCP on Shopify stores often fails even when product photos look fine in the admin.
How Shopify Stores Get Slow
Shopify performance problems cluster into four categories. Your Lighthouse report will show which ones apply:
| Issue | Typical Lighthouse audit | Impact |
|---|---|---|
| App scripts blocking render | render-blocking-resources | Delays LCP by 300–900ms |
| Large product/hero images | uses-optimized-images, modern-image-formats | Slow LCP element load |
| Unused JS from apps | unused-javascript, high TBT | Poor interactivity score |
| Heavy Liquid / slow TTFB | server-response-time | Delays every downstream metric |
Run a free audit on your store URL at PageSpeed Exporter or see the Shopify-specific landing page for a workflow tuned to theme and app issues.
1. Audit Every Installed App
Every Shopify app can inject JavaScript and CSS into every page — including your homepage, collection pages, and checkout-adjacent flows — even when the app only matters on the product page.
Step-by-step app audit:- Go to Shopify Admin → Settings → Apps and sales channels
- List every installed app. For each one, ask: Does this need to run on the homepage?
- Run Lighthouse on your homepage and open "Reduce unused JavaScript" — note script URLs containing app vendor domains (
cdn.shopify.com,shopifycloud.com, or third-party CDNs) - Uninstall apps you no longer use. For active apps, check whether the app settings offer "load on specific pages only" or deferred loading
Common high-impact offenders: exit-intent popups, live chat widgets, multiple analytics pixels, and review carousels that load on every template.
2. Fix LCP on the Homepage and Product Pages
On most Shopify themes, the LCP element is either the hero slideshow image on the homepage or the main product image on /products/* pages.
Preload the hero image
Add a preload hint in layout/theme.liquid inside , targeting your hero image URL. For themes that use a section setting:
{% if template == 'index' and section.settings.hero_image %}
<link
rel="preload"
as="image"
href="{{ section.settings.hero_image | image_url: width: 1200 }}"
fetchpriority="high"
>
{% endif %}
Use WebP via the image_url filter
Shopify's CDN converts images automatically when you request WebP format:
<img
src="{{ product.featured_image | image_url: width: 800, format: 'webp' }}"
alt="{{ product.featured_image.alt | escape }}"
width="800"
height="{{ 800 | divided_by: product.featured_image.aspect_ratio | round }}"
loading="eager"
fetchpriority="high"
>
Rules for LCP images on Shopify:
- Never use
loading="lazy"on the first visible product or hero image - Always set explicit
widthandheightto prevent CLS - Cap hero widths at 1200–1600px — larger sources rarely help LCP but always hurt transfer size
Product page template
On product pages, the featured media is almost always the LCP element. In product.liquid or your main product section:
{% assign lcp_image = product.selected_or_first_available_variant.featured_media
| default: product.featured_media %}
<img
src="{{ lcp_image | image_url: width: 900, format: 'webp' }}"
alt="{{ lcp_image.alt | escape }}"
width="900"
height="{{ 900 | divided_by: lcp_image.aspect_ratio | round }}"
loading="eager"
fetchpriority="high"
class="product-featured-media"
>
3. Defer Non-Critical Scripts in theme.liquid
Shopify themes often load theme.js, analytics, and app scripts synchronously in . Move non-critical scripts to the bottom of or add defer:
{{ 'theme.js' | asset_url | script_tag: defer: true }}
For third-party snippets apps inject via Theme settings → Custom pixels or app embeds, prefer Shopify's Customer Events API over raw tags in when the vendor supports it — pixels loaded through Shopify's sandbox defer more predictably.
See the full render-blocking resources guide for patterns that apply across platforms.
4. Reduce Total Blocking Time from Theme JavaScript
TBT measures main-thread blocking from JavaScript. Shopify themes built on heavy jQuery sliders, mega-menu libraries, and cart drawer scripts often score poorly here. High-impact TBT fixes:- Remove jQuery if your theme does not need it — modern themes can use vanilla JS for cart drawers and sliders
- Lazy-load below-the-fold sections — use Shopify section rendering API or Intersection Observer for review carousels and Instagram feeds
- Limit
document.addEventListener('DOMContentLoaded')chains — consolidate theme JS into one deferred bundle - Disable theme features you do not use — quick-view modals, predictive search, and infinite scroll all add JS cost
Check Lighthouse's "Avoid long main-thread tasks" audit — any task over 50ms adds to TBT. App scripts are the #1 source on Shopify; theme JS is #2.
5. Improve Time to First Byte (TTFB)
Shopify's infrastructure is fast, but complex Liquid templates and unbounded loops still inflate server render time. TTFB above 600ms delays LCP directly.
Liquid performance rules:- Avoid nested
forloops overcollectionsorproductsin global sections loaded on every page - Use
{% cache %}tags for static section fragments (where supported by your theme architecture) - Minimize calls to
all_products[handle]in loops — each lookup is expensive - Keep app blocks out of
layout/theme.liquidwhen possible — load them only in relevant sections
If TTFB remains high after theme cleanup, the bottleneck may be a specific app modifying HTML server-side. Temporarily disable apps one at a time and re-test.
6. Fix Cumulative Layout Shift on Collection Pages
Collection grids are a common CLS source when product card images lack dimensions or when star ratings / sale badges inject after load.
<div class="product-card" style="aspect-ratio: 3/4;">
<img
src="{{ product.featured_image | image_url: width: 400, format: 'webp' }}"
alt="{{ product.title | escape }}"
width="400"
height="533"
loading="lazy"
>
</div>
Reserve space for dynamic elements (review stars, "Sale" badges) with min-height on the card container so content below does not jump when apps hydrate.
Shopify Speed Optimization Checklist
Use this ordered checklist — each step targets the highest-impact issue first:
- Run Lighthouse on homepage + top 3 product pages (mobile strategy)
- Uninstall unused apps — re-test after each removal
- Preload + WebP + dimensions on hero and primary product images
- Defer theme.js and move chat/analytics to bottom or lazy load
- Audit Liquid for expensive loops in global sections
- Fix CLS on collection cards with aspect-ratio and explicit image sizes
- Re-test and export JSON for AI-assisted fixes if audits remain
Before and After: Home Page Case Study
| Metric | Before | After | Change |
|---|---|---|---|
| Mobile performance score | 54 | 76 | +22 |
| LCP | 4.6s | 2.3s | −2.3s |
| TBT | 890ms | 310ms | −580ms |
| CLS | 0.18 | 0.04 | −0.14 |
Changes applied: removed 3 apps, preloaded hero WebP, deferred theme JS, set product card dimensions. Total engineering time: ~4 hours.
Using AI to Fix Shopify-Specific Issues
Export your Lighthouse JSON from PageSpeed Exporter and paste it into Claude or ChatGPT with:
I'm attaching a Lighthouse report for my Shopify store at [store.myshopify.com].
Please identify the top 5 performance issues specific to Shopify themes and apps.
For each issue, provide the exact Liquid or theme.liquid change needed.
Prioritize fixes that improve LCP and TBT.
The report's stackPacks field may include Shopify-specific hints when Lighthouse detects the platform.
Further Reading
- Shopify store speed audit tool
- How to fix LCP using AI
- Fix render-blocking resources
- What are Core Web Vitals?
- 5 quick Lighthouse wins