What code changes does AMP make?

Written By Stephen Gardner (Super Administrator)

Updated at May 14th, 2021

AMP by Shop Sheriff makes almost no code changes to your shop, so it is very easy to add or remove from your shop without changing any core functionality or affecting any of the functionality on your original theme.   

All of the code changes we make are the following:

  1.  We create a snippet titled shop-sheriff-amp.liquid
  2.  We add one line to the theme.liquid file: {% include 'shop-sheriff-amp' %}

That is the entirety of the code modifications we make to your shop.

What does the shop-sheriff-amp.liquid snippet do?

The shop-sheriff-amp.liquid snippet simply adds one single <link rel="amphtml" href="DYNAMIC_AMP_URL"> meta tag to the original (non-AMP) page.  This meta tag doesn't affect any functionality on your shop, but instead it tells Google "index the AMP version of this page which is located at the DYNAMIC_AMP_URL portion of this metatag."

What does the {% include 'shop-sheriff-amp' %} line of code do?

Simple! It just tells the theme template to include the previously mentioned snippet tag on the page. 

How do I remove all code changes that AMP made?

Doing so is very easy, all you do is remove the line of code from your theme.liquid, and then optionally remove the shop-sheriff-amp snippet.  Here are our full instructions:

  1. Open your theme.liquid file in your Shopify Admin Panel
  2. Remove the line of code that reads: {% include 'shop-sheriff-amp' %}.
  3. Now remove the snippet file snippets/shop-sheriff-amp.liquid.

Was this article helpful?