Re: Shopify Preview URL Generated

Solved

How can I remove the preview URL from my website?

pratimasrivasta
New Member
5 0 0

Hello Team,

 

 My website www.bioayurveda.in is generating a preview link i.e. https://di1u8g78awl5twr0pl98a9p3ph9eqw8-1815150657.shopifypreview.com/

Please guide me on how to remove this URL from my website

Any response would be appreciable

Thanks you,

 

Accepted Solution (1)
Moira
Shopify Staff
2118 231 339

This is an accepted solution.

My pleasure @pratimasrivasta, don't hesitate to reach back out if you require any further assistance as you continue to work on your store. 

All the best,

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 7 (7)

Moira
Shopify Staff
2118 231 339

Hey @pratimasrivasta,

Welcome to the Shopify Community! I'll be happy to help you out with this.

Do you recall creating a preview link within the last few weeks and sharing it? If you’re launching a new store for a client or you’re planning to change its look and feel, you are able to share theme previews. Themes don’t need to be published to be shared, instead a preview link lets merchants and other important stakeholders explore your online store or development store. In addition, theme previews don’t allow anyone to access the checkout, keeping your client’s store safe.

After you create a preview link, it remains active for 14 days. You can create new links as often as you like, and creating a new link won't affect old preview links. Depending on when you created the link, it will be disabled within the next 14 days so you do not need to remove it yourself.

As a refresher, to create a preview link inside the Shopify Admin, go to Online Store > Themes. For the theme you want to share, click on Actions, and then Preview:

21-09-hvbz1-a7oim

For further guidance take a look at our help document below:

As a side note, I love the work you've done on your website so far. Certain products like the Bio Natural Pure Rose Water stand out to me because of the great job you've done with the product images and description. Have you thought about who your target customer is for your website? Our blog post on Building a Buyer Persona talks about narrowing down who your ideal customer is. This process is good to go through so that you can get the most out of your marketing!

If you have any questions please feel free to thread those below.

Cheers!

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

pratimasrivasta
New Member
5 0 0

Thanks for the reply

Moira
Shopify Staff
2118 231 339

This is an accepted solution.

My pleasure @pratimasrivasta, don't hesitate to reach back out if you require any further assistance as you continue to work on your store. 

All the best,

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Abhinav_Panse1
Shopify Partner
4 0 0

Hello Moira, 
Do you know any way to get the preview url of some blog/article preview url from admin rest api or graphql api??

Moira
Shopify Staff
2118 231 339

Hey @Abhinav_Panse1,

 

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} 

 

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.

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog

Abhinav_Panse1
Shopify Partner
4 0 0

Thank you Moira. 

But I'm building a shopify app, so I don't have access to get preview_key. I can ask user to give me storefront password and I can save it in my database.

Is there any programmatical way I can get preview url.


Moira
Shopify Staff
2118 231 339

Ah I see! Unfortunately, as of the current Shopify API (both REST and GraphQL), there's no direct way to generate a preview URL programmatically for a blog or an article. The preview_key is a security measure that Shopify uses to ensure only authorized users can preview unpublished content.

 

If you have the storefront password, you can construct a password-protected URL for the blog or article, but it won't be a "preview" of unpublished content. It would just be a URL that's accessible behind the storefront password.

 

Otherwise, for a true preview functionality within your app, you might need to build a custom preview feature. This could involve fetching the blog content via the API and displaying it in your own app's interface.

Moira | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog