delete tag problem

Have unused tags in inspector. Have erased and or deleted them but they continue to reappear. It will ‘reload’ them on a scene change or reopening program. Have deleted tagmanager file and notice that they along with some more get rewritten at startup. Also have thought to make sure no script or object refers to the tags anymore.
Have tried looking for answer but can not find one so I am hoping community can help?

This is an old thread but this is happening to me in Unity 5.2.3

Any ideas to solve this problem?

have you figured it out?

This thread is almost three years old. So I assume you are having the same issue.
If you delete a tag, the tag will automatically be re-added to the list of tags if there is an existing game object in the scene which uses the tag. So you have to find the gameobject which is using the tag you’re trying to delete.
You can use GameObject.FindGameObjectsWithTag(string tag), to find the culprit.
http://docs.unity3d.com/ScriptReference/GameObject.FindGameObjectsWithTag.html
Note the gameobject must be active or unity won’t find the gameobject.

3 Likes

Don’t forget you also need to search through your prefabs in the project as the tag be assigned here also. This will also stop the tag from being deleted.

2 Likes

In my case (unity 2019.1.11f1), after some tags deletions, the method:
GameObject.FindGameObjectWithTag
Stoped working as expected, and didn’t find some existing tags.
Restart to the editor fixed it, I stopped seeing the in the Tags editor, and
the above method stated to work.

1 Like

This helped me in 2021

Helpful tip for anyone experiencing this:

If you want to quickly change all of the objects with a specific tag in your scenes and prefabs (as for Unity to FINALLY let you delete the tag), use an extended text editor like Notepad++ to replace the exact string of your tag in all of your *.unity (scene) and *.prefab files in your project.

Example:

I have a tag I no longer use scattered around my game called “Now_Unused” and I want to get rid of it after first setting all objects with the tag as Untagged.

In Notepad++, open the Find dialogue (Search->Find or Ctrl+F), click on the “Find in Files” tab, and write “Now_Unused” into the Find box, “Untagged” into the Replace box, set the file filters to be “*.unity *.prefab” and set the find Directory to be your project’s assets folder.

8872314--1211433--upload_2023-3-13_5-9-51.png

Click on “Replace in Files”, and it’s done. Mass untagging complete! Now, Unity will finally let you remove it! Gahhhh!!!

4 Likes

You just saved my day!!!
BTW, you can specify the search by adding m_TagString: 8982496--1236010--upload_2023-4-30_12-54-8.png

This is awesome! Wouldn’t have been able to clean up my tag system without this.

But there WERE some stragglers even after finding and replacing.

If you have prefabs with nested prefabs in them, it’s possible for those to be set to a different tag and this will not fix those edge cases

I found the best way to find these (if you happen to have a scene with most your assets in them), is alt click the collapse arrow at the top of your scene window twice, this will expose all assets and sub assets. Start at the top of the list and just hold the down arrow until you see an unusual tag pop up in the inspector window.

1 Like