Stape
Search
Try for free

Step-by-step guide to deleting a GTM container

Updated
Feb 27, 2025
Published
Feb 24, 2025

In this guide, we will show you how to delete the container in your GTM account, create a backup file with container settings to return to it later (if needed), remove the GTM snippet from the website, and answer the frequently asked questions about container deletion.

Before deleting the GTM container

Before deleting the GTM container, it is worth exporting its current version. This will be helpful if you decide to recover it or use the previous configurations as a reference for a new container.

To export the container, choose the container you want to delete (steps 1 and 2 below show how to do this), click "Export Container," → choose a container workspace or version to export.

Export GTM container

Click "Export" in the upper right corner. The file in JSON format will be downloaded to your computer. Keep the file in a secure location so you can access it later if necessary.

Click export

How to delete a GTM container

Step 1. Access GTM account

Navigate to GTM → choose an account (in case you have a few) that has the container you want to delete.

Choose an account in GTM

Step 2. Navigate the container you want to delete

Click on the "Admin" tab, and in the column on the right side, choose the container you want to delete if you have a few containers.

Containers in GTM

Step 3. Delete container

To delete the container, click on "Container Settings" → three dots in the upper right corner → select the 'Delete" option. This action will trigger a "confirmation dialog" to ensure the user is certain about the deletion.

Container Settings in GTM

How to remove a GTM container from a website

Remove the snippet from the website

Removing the GTM code snippet depends on how you added it to the website - manually or using plugins for CMS.

Remove manually

  1. Open your website’s source code.
  2. Locate the GTM container code, which is typically found in two places:

The section:

GTM snippet on the website

And section:

GTM snippet

You should delete both of these snippets and save the changes.

Remove GTM from the CMS plugin

If you have used the plugin to add the GTM snippet code, you can deactivate or remove the plugin.

Clear cache and verify GTM code removal

Clear your website’s cache and open your site in an incognito window. Check the source code (right-click → "View Page Source") and search “gtm.js” to make sure that the GTM snippet is gone.

View page source

How to manage GTM container effectively

If you are looking for a tool that allows you to easily manage the tags inside a GTM container (and even delete containers in bulk), have a look at GTM Tools. With its help, you can:

  • Manage container assets. Delete or clone the container, explore various tools such as Inspect, Visualize, Clone, and Workspace mode. These features enable you to structure, visualize, duplicate, and efficiently update multiple elements within your GTM container.
  • Conduct container audit. Identify dependencies between assets, making it easy to detect and remove unnecessary Tags, Triggers, and Variables.

See the detailed guide on how to effectively use GTM Tools.

GTM tools

To sum up

Managing your Google Tag Manager account requires careful consideration and attention to detail. Deleting or restoring containers is a part of GTM account management. Before deleting a container, it is worth exporting a file with container configuration if you need it in the future. After deleting a container, update the code snippets on your website to avoid conflicts and ensure precise data collection.

FAQs

Can I stop using a GTM container without deleting it?

Yes, you can remove the GTM code snippet from your website. You should remove both the

Try Stape for all things server-sideright now!