Skip to main content
To prevent customers from accessing the Order Protection product page directly, you can create a custom Shopify product template that automatically redirects visitors back to the homepage.
1

Navigate to your theme code

Go to Online Store > Themes in your Shopify admin. Click Actions > Edit code on your live theme.
2

Create a new product template

Navigate to the Templates folder and click Add a new template. Select Product as the template type and name it product.op-redirect.liquid.
3

Add the redirect code

Paste the following code into the new template:
{% layout none %}
<!doctype html>
<html>
  <head>
    <meta http-equiv="refresh" content="0; url=/" />
    <script>location.replace('/');</script>
  </head>
  <body></body>
</html>
4

Save the template

Click Save to store the new template.
5

Assign the template to your OP product

Go to Products in your Shopify admin and find your Order Protection product. Change the Template dropdown from op-default to op-redirect.
6

Save the product

Click Save on the product page. Customers who navigate to the Order Protection product page will now be automatically redirected to your homepage.