Where Are Mac OS Tags Saved?

I would like to create a macro to delete selected tags from all files with those tags. Several years ago, I trialed some software that took it upon itself to assign tags of its own design to every file on my hard drive. I want to remove them.

The first step in this process is getting a list of all of the tags being used but I haven't found where Mac OS (Ventura) stores all the files in use.

Can anyone on this forum tell me where these tags are stored and how to get them into a separate list? Is there a terminal command that will list them or a 3rd party tool or any other way?

Thanks in advance for any guidance.

There might be a simpler way to do this, without needing a Macro.

In Finder, go the menu item Finder>Settings... and then click on the Tags tab.

This will list all the tags you have on your Mac.

Scroll down to any tag you want to completely remove, select it and press the "-" button. You will get a warning like this:

This will remove the selected tag from the list of tags and remove it from any item that was tagged with it.

Thank you, Zabobon.

Yes. I know of that method and I may have to resort to that.

The software I mentioned in my OP added a LOT of tags. I was hoping to create a list of the ones I wanted to remove and feed it to a process (script, etc.) to loop through the tags.

But, as you said, there is a manual way of doing this.

Do you know where Mac OS stores all of the tags being used? I assume it's a plist of some kind but I haven't found a source to identify where or how to view or copy the list.

UPDATE: Zabobon:

I just found a Terminal utility called Tag that includes a command to list ll tags.

My system had over 3,300 tags. I doubt that I've created more than 200 -- and that's probably a very high guess.

The rest were created by that software I trialed. Some of the tags included @ symbols, "" marks, single', numbers with and without decimal points. The logic used to create the tags baffles me.

For now, I'm using the manual process you described to purge these tags. The process is hit and miss. For some reason, tags that start with @ or % seem to resist being deleted.

That's probably more than you wanted to know ... :slight_smile:

Oh wow. I see why you can't delete thousands of tags one at a time.

I'm sure you already know that in the Finder Tag Settings you can multiple-select and delete lots of tags in one go? But I suppose the unwanted tags are all mixed up with the tags you want to keep?

If that is the case, even with a text list of all your tags it would be a process to edit that list to all the ones you wanted to delete.

Keyboard Maestro has actions to add and remove tags to selected files. But you would have to first select the files you want to act on. Are the unwanted tags used on specific files or folders or are they distributed throughout all your files?

And without testing I don't know if it is the case that if a tag is not used on any file it ceases to exist in the system list.


Take a look at this topic on the Late Night Software Forum

Unfortunately this will not get you where you want to go – at least directly.

I'm not presently aware of a utility that will manage macOS tags en mass, and I think the only likely solution will be to use sqlite from the command line.