How do I remove code after uninstallation?

Removing the very small amount of code (if any) that AMP adds to a theme

Written By Stephen Gardner (Super Administrator)

Updated at June 2nd, 2022

If you click "Unpublish" before uninstalling the app, then there won't be any code left on your theme, and you can uninstall the app from your Shopify Admin Panel. If you don't click "Unpublish", then there may be code left on your theme which you can manually remove very easily:

Steps to manually remove all the code:

  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.

That's the entirety of the code modifications we make to your shop.  This also effectively "Unpublishes" your AMP pages, so Google will not try to index your AMP pages anymore.

I received a 404 error after uninstalling the app

This may happen if you don't "Unpublish" the pages before uninstalling the app.  

Google may have indexed your AMP pages, and if you uninstall the app, the pages no longer exist, so you may see a 404 issue for AMP pages on your Google Search Console, or on Google search.  To avoid this, please first click "Unpublish" and then wait a few days for Google to de-index the AMP pages before uninstalling the AMP app.  

When unpublishing AMP, it may take a few days for Google to un-index the AMP pages.  For this reason, we recommend keeping AMP installed while Google de-indexes your AMP pages.  Unfortunately, there is no way around this due to how Shopify controls your URLs once you uninstall the app.

If you are using a DNS service like Cloudflare, you may be able to use their redirection rules to redirect pages from mysite.com/a/s/ -> mysite.com. This means you would just remove the a/s/ from the URL. We are extremely cautious about using DNS redirection rules so we do not have an official guide for this, and we warn doing this at your own risk. In general, we simply recommend waiting a few days for Google to de-index the AMP pages, and you'll be all set.

I don't know how to edit my code in my Shopify Admin Panel, I need your help!

If you aren't comfortable editing your theme.liquid file in Shopify, you can share collaborator access with us and we can log in to your shop and perform this for you.  Contact us at [email protected] and we'll be happy to help.

Was this article helpful?