How can I remove the preview URL from my website?

Topic summary

Issue: A public-facing preview URL (shopifypreview.com) appeared for a Shopify store.

Key points:

  • Theme preview links are intended for sharing unpublished theme changes. They don’t allow checkout and auto-expire after 14 days; no manual removal is needed.
  • Merchants can generate previews via Admin > Online Store > Themes > Actions > Preview. A help doc is provided. A screenshot illustrates where to find the Preview action.

Outcome for original question:

  • No action required beyond waiting for expiration (up to 14 days). The matter is effectively resolved.

Follow-up (developer question):

  • Asking for a way to get a blog/article preview URL via Admin REST or GraphQL.
  • Direct retrieval or programmatic generation is not supported. You can construct a preview URL only if you have the blog handle and the preview_key, but preview_key is generated when clicking “Preview” in Admin and is not accessible via API.
  • Storefront password allows access to password-protected content, not unpublished previews.
  • Suggested workaround: build a custom preview inside the app by fetching content via the API and rendering it yourself.

Status: Original issue resolved by expiry; API limitation remains with a suggested workaround.

Summarized with AI on January 13. AI used: gpt-5.

Hey @abhinav_panse ,

You can retrieve the preview URL of a blog/article in Shopify using the Admin API. However, directly getting the preview URL is not available via the API. Instead, you can construct the preview URL manually.

Retrieve the blog’s handle: You can get the handle of a blog using the Shopify Admin API. For instance, to get the handle of a blog, you can use the following endpoint:

GET /admin/api/2022-01/blogs/#{blog_id}.json

The response will include the handle of the article.

Create the preview URL: Once you have the blog’s handle, you can form the preview URL in the following structure:

[https://{shop}.myshopify.com/blogs/{blog_handle}?preview_key={preview_key}](https://{shop}.myshopify.com/blogs/{blog_handle}?preview_key={preview_key}) 

In this structure, {shop} is your shop name, {blog_handle} is the handle of your blog, and {preview_key} is the preview key for your shop.

The preview_key is not accessible via the API. It’s generated when you press the “Preview” button in the Shopify admin. You can locate it in the URL after you press the “Preview” button.

Please note that this method is only applicable for the store owner or staff with the appropriate permissions, as the preview key is necessary.