# Check If a Tag Is Used Before Deleting or Renaming

**URL:** <https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485>\
**Category:** Ignition\
**Created:** [May 17, 2012, 7:34am UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485 "2012-05-17T07:34:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![aidamcg](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aidamcg](https://forum.inductiveautomation.com/u/aidamcg)\
**Post date:** [May 17, 2012, 7:34am UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/1 "2012-05-17T07:34:41Z")

</div>

Hi

Not sure if this is possible but it would be useful if a check would be done to see if a tag is used in the project before Deleting or Renaming

Aidan

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [May 17, 2012, 2:17pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/2 "2012-05-17T14:17:46Z")

</div>

Alternatively could we generate a list or highlight orphaned tags that aren’t being used?

---

<div class="post-metadata">

**Author:** ![aidamcg](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aidamcg](https://forum.inductiveautomation.com/u/aidamcg)\
**Post date:** [May 18, 2012, 8:39am UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/3 "2012-05-18T08:39:52Z")

</div>

That is another good request. I suppose what I am looking for is similar to what a Control Logix can do. It will not allow a Tag to be deleted that is in use and also it will generate a list of all unused tags

Aidan

---

<div class="post-metadata">

**Author:** ![jay](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jay](https://forum.inductiveautomation.com/u/jay)\
**Post date:** [May 18, 2012, 7:00pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/4 "2012-05-18T19:00:01Z")

</div>

I think it would be impossible to make an accurate list of which tags are used or not used since tagnames can be constructed on the fly within scripts and through parameter passing to template windows.

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [May 21, 2012, 12:49pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/5 "2012-05-21T12:49:26Z")

</div>

I think you might be confusing the difference between a variable and a tag…

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 21, 2012, 1:02pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/6 "2012-05-21T13:02:44Z")

</div>

[quote=“gbuehler”]I think you might be confusing the difference between a variable and a tag…[/quote] Not necessarily. An example is [here](http://inductiveautomation.com/forum/viewtopic.php?f=25&t=7436) where tags are created via scripting. The problem that I see is that a tag can be used anywhere, across projects and even across servers, making it difficult to know exactly where a tag is being used.

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [May 21, 2012, 1:42pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/7 "2012-05-21T13:42:01Z")

</div>

I retract my previous statement 😊

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 21, 2012, 4:17pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/8 "2012-05-21T16:17:30Z")

</div>

Don’t sweat it. I’ll admit that it was an odd duck of an application. But it does show that if it can be done externally (not necessarily through Ignition) to a database, it can also happen to a tag. Learned that one the hard way, once. I had one script to giveth a tag and one script to taketh away. 😆

---

<div class="post-metadata">

**Author:** ![seancourtney](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@seancourtney](https://forum.inductiveautomation.com/u/seancourtney)\
**Post date:** [June 13, 2014, 9:01pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/9 "2014-06-13T21:01:17Z")

</div>

bump!!

PLEASE!!! what this is absolutely necessary, and listed by project too!!!

---

<div class="post-metadata">

**Author:** ![mreynolds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mreynolds/32/7515_2.png) [@mreynolds](https://forum.inductiveautomation.com/u/mreynolds)\
**Post date:** [April 19, 2019, 4:47pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/10 "2019-04-19T16:47:35Z")

</div>

Sadly I still don’t see any good way to check if tags are used or not. I have a number of Ignition gateways where the tags have become a dumping ground for all kinds of randomness. I would love to find out what’s actually being used or not so it could be cleaned up.

With new projects I have started creating new tag providers that are specific to a particular project. That way at least where something is used can be narrowed down in the future. That doesn’t really help me now though.

Tags can be bound to screen elements, can use indirect addressing and tag addresses can be generated by scripting.This certainly makes it challenging to find where the writes are coming from. I was thinking the Audit Log or something similar could be of use here. Since the Audit Log keeps track of what tags were written to, not finding a tag in there is good indication that it’s not setup to be written to (although not proof). As far as I can tell there’s nothing similar keeping track of tag reads so any tag which just monitors data can’t be determined this way.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [April 19, 2019, 5:18pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/11 "2019-04-19T17:18:50Z")

</div>

You’ve identified the crux of the issue: due to dynamic reading and writing (indirect), there is no way to determine 100% whether a tag is used or not. Even auditing may not be 100%, as there could always be some component which hasn’t met the write condition.

Separating tags by project is the practice I recommend, but you’re correct that it doesn’t solve troublesome decisions from the past.

The Find/Replace functionality can be used as a starting point, but - again - dynamic reading/writing could always sneak up on you.

---

<div class="post-metadata">

**Author:** ![robmann](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@robmann](https://forum.inductiveautomation.com/u/robmann)\
**Post date:** [February 3, 2020, 7:02pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/12 "2020-02-03T19:02:33Z")

</div>

If tags date stamped when if was last read it would be the only solution to indirect tags I can think of

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [February 3, 2020, 7:23pm UTC](https://forum.inductiveautomation.com/t/check-if-a-tag-is-used-before-deleting-or-renaming/4485/13 "2020-02-03T19:23:18Z")

</div>

I agree this would be really useful and wonder how reasonable it would be for IA to implement.

> [@Quick way to find unused tags?](http://forum.inductiveautomation.com/t/quick-way-to-find-unused-tags/31490/5):
>
> How crazy an idea would it be to have a last read timestamp property on tags?
