Share an unpublished theme preview

Send an unpublished Shopify theme preview to a client or team: visitor links on shopifypreview.com, merchant previews, expiry and the preview_theme_id bug.

Visitor link
https://<token>-<shop_id>.shopifypreview.com
Expires
Visitor 2 days, merchant 30 days
Login
Visitor: none; merchant: admin login
Plan
Every plan
Last checked

In short

Open the theme’s Preview in Online Store and click the share button in the preview bar: you get a visitor preview link on <token>-<shop_id>.shopifypreview.com that anyone can open without logging in for 2 days. The merchant preview URL in your address bar needs an admin login, reaches checkout and lasts 30 days. A preview_theme_id parameter on live URLs is a theme bug that shows the preview bar to everyone.

How to use it

  1. In the admin, go to Online Store, open the actions menu (…) of the theme and click Preview.
  2. Optional: choose a country or language in the preview bar so the reviewer sees that market.
  3. Click the share button in the preview bar to copy the visitor link, and send it.
  4. Create a fresh link when it expires; new links don’t break old ones.

Code

find-preview-theme-id.txt
# The preview bar shows on the live store for every visitor?
# Look for this parameter in the address bar of a live URL:
preview_theme_id

# Then search the theme code for it (Edit code > search), most likely in:
layout/theme.liquid
assets/*.js

# Remove the code that adds preview_theme_id to links or redirects.
preview-links.txt
# Visitor preview: anyone with the link, no login, expires 2 days after creation
https://<token>-<shop_id>.shopifypreview.com

# Merchant preview: your primary domain with a token parameter,
# needs admin login, can reach checkout, expires 30 days after creation
# (shown in the address bar after Online Store > theme > ... > Preview)

# Where to create the visitor link
Online Store > (theme) ... > Preview > share button in the preview bar > copy link

Written by Lintel. MIT license: free to use in your own store and in client work.

Limits and edge cases

  • Only the merchant preview (with admin login) has access to checkout; use it when you need to test a checkout on the new theme.
  • If previewing a draft theme sends you to the live theme, Shopify’s help points to Cloudflare caching in front of the store.
  • If the preview bar shows up on the live store, search the theme’s layout and .js files for preview_theme_id and remove the code that adds it to URLs.
  • A missing preview bar usually means content_for_header was changed in theme.liquid.

Questions

How do I share a Shopify theme preview with a client?
Preview the theme from Online Store, then click the share button in the preview bar. The link works for anyone for 2 days.
Why does my Shopify preview link stop working?
Visitor preview links expire 2 days after you create them. Create a new one from the preview bar.
What is preview_theme_id?
An internal parameter Shopify uses for previews. If your theme adds it to live URLs, every visitor sees the preview bar; remove the code that adds it.
Does the theme have to be published to share it?
No. Any theme in your theme library can be shared as a preview.
  • Checked on a Shopify store on the date shown. Shopify changes its admin often; if a step looks different, the idea usually still works.
  • Examples use placeholder IDs and your-store.myshopify.com. Replace them with your own.
  • MIT license for the code snippets.

Need this built, tested and maintained for your store? See Shopify development.

Have something to build? Let’s talk it through.

Taking a limited number of projects at a time. Every brief is read by an engineer, not a salesperson.

Gencer KarakayaShopify Engineer

An engineer reads your brief, and we reply by email.