# Reducing Unnecessary Tags

**URL:** <https://forum.inductiveautomation.com/t/reducing-unnecessary-tags/60142>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [May 27, 2022, 7:25pm UTC](https://forum.inductiveautomation.com/t/reducing-unnecessary-tags/60142 "2022-05-27T19:25:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Saim](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Muhammad\_Saim](https://forum.inductiveautomation.com/u/Muhammad_Saim)\
**Post date:** [May 27, 2022, 7:25pm UTC](https://forum.inductiveautomation.com/t/reducing-unnecessary-tags/60142/1 "2022-05-27T19:25:39Z")

</div>

Hello

I’m trying to reduce the number of unused/junk tags in our IO gateway (tag browser), but I’m not sure which tags are currently being used within screens.

I was extracting the tags from the screen XML’s but I’m not sure if all the tags within a screen show up in the XML. I’m using xml to find the strings and checking if the string has backslashes

Very low level example below with details missing

```auto
import xml.etree.ElementTree as ET
from xml.etree import ElementTree

tree = ET.ElementTree(ET.fromstring(input))
root = tree.getroot()

items = root.findall(".//str")
for item in items:
    if(item.text is not None and "/" in item.text and '"' not in item.text):
           .....

```

1. Is there an efficient programmatic way for me to get all the XMLs for a project instead of me copying and pasting into a text box? There are way too many screens for me to do that

2. Is there any way to extract all the tags used within project screens?

Thank you so much!!

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [May 27, 2022, 8:26pm UTC](https://forum.inductiveautomation.com/t/reducing-unnecessary-tags/60142/2 "2022-05-27T20:26:23Z")

</div>

You can export your tags by selecting them in the tag browser, right clicking and clicking “Export Tags”:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ec423c6fd6a43a0b1c986ffaca0858e5f4930de1.png)  
That will give you either a `json` or `xml` document which you can then parse through:

```xml
<Tags MinVersion="8.0.0" locale="en_US">
   <Tag name="Refresh_Query_Tags" type="AtomicTag">
      <Property name="valueSource">memory</Property>
      <Property name="dataType">6</Property>
      <Property name="documentation">Put this value in database queries (WHERE {[~]/Refresh_Query_tags} = {[~]/Refresh_Query_tags}) to force an update on those bindings when this value is changed.</Property>
      <Property name="tooltip">Toggle to update database connections</Property>
      <Property name="value">false</Property>
   </Tag>
</Tags>

```

You can export any and all parts of a project via the same method. You’ll have to play around with it and do some cross referencing to accomplish what you’re trying for here. In hindsight, I’d say this is a problem easier prevented than fixed.

To your second question, no, but it’s in the works! You can upvote the tag finding feature on the features and ideas page here:  
[Tags Cross Reference | Voters | Inductive Automation](https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/tags-cross-reference)

---

<div class="post-metadata">

**Author:** ![Muhammad\_Saim](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Muhammad\_Saim](https://forum.inductiveautomation.com/u/Muhammad_Saim)\
**Post date:** [May 27, 2022, 8:41pm UTC](https://forum.inductiveautomation.com/t/reducing-unnecessary-tags/60142/3 "2022-05-27T20:41:30Z")

</div>

Thanks @Brandon_Peterson for the input

“You can export any and all parts of a project via the same method” - can you bulk export screens the same way or through a script. I only see copy XML for single screens

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/2778fd1d8e786be785f4b5f159da0cff948b2747.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [May 27, 2022, 9:14pm UTC](https://forum.inductiveautomation.com/t/reducing-unnecessary-tags/60142/4 "2022-05-27T21:14:58Z")

</div>

Is `File` → `Export...` what you’re looking for? That will pull a menu up where you can select as many project resources as you want, including screens.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 29, 2022, 8:31am UTC](https://forum.inductiveautomation.com/t/reducing-unnecessary-tags/60142/5 "2022-05-29T08:31:40Z")

</div>

It’s possible to find tags directly used on pages, but it’s very difficult to find dynamically referenced tags. For my projects, the vast majority of bindings I use are indirect…
