Sub topic 2
Applying and removing tags
This chapter assumes you can move around Finder windows and folders, know the difference between a file and a folder, and are comfortable with menus and keyboard shortcuts. It covers every common way to add and remove tags, how tags behave when files are copied or moved, and the errors people hit most often. Renaming tags and changing their colors comes in the next chapter.
What a tag is
A tag is a short label stored with a file or folder. It is not a folder and it does not move the item. One item can carry many tags, and many items can share one tag. That is what lets you organise files without moving them.
Tags are stored as part of the item's metadata, which is data about the file. On APFS and HFS+ volumes, macOS keeps the tag list in an extended attribute named com.apple.metadata:_kMDItemUserTags. Spotlight reads that attribute and exposes it as kMDItemUserTags, which is the name you will see in Terminal later in this tutorial.
A tag has a name and, optionally, a color. The color is a property of the tag name, not of an individual file. Every item tagged "Red" shows the same red dot.
Ways to apply a tag
Select one or more items in Finder first. Then use any of these methods.
The Tags button in the toolbar
Click the Tags button (the tag icon) in the Finder toolbar. A popover lists your tags. Click one to apply it. If the button is not visible, choose View > Customize Toolbar and drag it in.
The File menu and the context menu
The File menu shows a row of colored dots at the bottom with a "Tags…" item. Control-click (right-click) an item and the same dots appear at the bottom of the context menu. Clicking a dot toggles that tag on the selection.
The Tags field in the Get Info window
Press Command-I. In the Get Info window, the Tags field sits near the top. Click it, type a tag name, and press Return. As you type, macOS suggests existing tags. Typing a name that does not exist creates a new tag.
The Tags field in the Save dialog
When you save a new document from many apps, the Save dialog has a Tags field. Tags added there are written when the file is first saved. This is the cheapest way to tag a file, because you do it once at creation.
Dragging onto a sidebar tag
If a tag appears in the Finder sidebar, drag one or more items onto that tag name. The items receive the tag. The sidebar is covered in later chapters.
The keyboard
Finder has no default shortcut for a specific tag. Two approaches work well:
- Select the item, press Control-click for the context menu, then press the key for the dot you want.
- Open Get Info with Command-I, press Tab to reach the Tags field, type the first letters of a tag, and press Return.
If you use tags constantly, you can assign shortcuts in System Settings > Keyboard > Keyboard Shortcuts > App Shortcuts. Add a shortcut for the exact menu title shown in Finder's File menu. The tag-dot row is awkward to target this way, so many people instead use the "Tags…" item, which opens the popover.
Applying several tags at once
You can add more than one tag to the same item. In the Get Info Tags field, type a name, press Return, and then type another. In the toolbar popover, click each tag in turn. Each click adds to the existing set. It does not replace it.
Ways to remove a tag
Removing a tag only changes the item's label list. The tag itself stays in your tag list, and other items keep it.
- Toolbar or context menu: Select the item and click the same colored dot again. It toggles off.
- Get Info: Click a tag in the Tags field to highlight it, then press Delete. The tag disappears from that item only.
- Finder window with a tag column: In List view, you can add a Tags column through View > Show View Options. Selecting a tag in the column and deleting it works the same way as in Get Info.
- Remove all tags: Open the Tags popover or the context menu, then choose the "None" behavior by clicking each active dot. There is no single "clear all" menu item in every macOS version, so in Get Info you can click in the Tags field, press Command-A to select all the tag text, and press Delete.
Removing a tag from an item is different from deleting the tag from your system. Deleting the tag itself is covered in the next chapter.
Seeing tags on items
In Icon view, a colored dot appears beside the file name. In List view and Column view, dots appear next to the name. If an item has several tags, you see several dots overlapping. A tag with no color shows no dot, so a tag can be present and still invisible in the file list. The Get Info window always shows the full set.
To see the tag names in a list, add the Tags column in List view, or use Get Info.
Tags on folders
You can tag a folder. The tag belongs to the folder itself. It does not spread to the files inside. If you tag a folder "Project A", searching for that tag returns the folder, not its contents. To tag everything inside, open the folder, select all items with Command-A, and apply the tag to the selection.
What happens to tags when files move
Tag behavior depends on how the item travels.
| Action | Tags kept? |
|---|---|
| Move within the same volume | Yes |
| Copy within the same volume | Yes |
| Copy to another APFS or Mac OS Extended volume | Yes |
| Copy to a FAT or exFAT drive | Often no, or stored in a hidden `._` file |
| Send as an email attachment or upload to the web | No |
| Compress into a ZIP with Finder's Compress command | Usually yes inside the archive on macOS, lost elsewhere |
| Sync with iCloud Drive | Yes between Macs and iOS devices on the same account |
The practical rule is that tags travel well between Macs and poorly outside them. Because tags live in extended attributes, any tool that does not preserve extended attributes drops them. Cloud services and some backup tools fall into this group.
Inspecting tags in Terminal
You can confirm what Finder is doing. This command prints the tags stored on a file as Spotlight metadata, which is the same data Finder uses when you search by tag.
mdls -name kMDItemUserTags ~/Documents/report.pdfIf the file has the tags Red and Project A, the output looks similar to this:
kMDItemUserTags = (
Red,
"Project A"
)A file with no tags prints kMDItemUserTags = (null). If you just applied a tag and mdls still shows the old value, wait a few seconds. Spotlight updates its index shortly after a change.
A worked example
You have a folder of invoices and want to flag the unpaid ones without moving them.
- Open the folder and select the three unpaid invoices with Command-click.
- Press Command-I. If Get Info opens one window per file, hold Option while choosing File > Show Inspector instead, which shows a single window for the whole selection.
- Click the Tags field, type
Unpaid, and press Return. Because the tag does not exist yet, macOS creates it. - Close the window. The three invoices now carry the tag.
- Later, once one invoice is paid, select it, open Get Info, click
Unpaidin the Tags field, and press Delete.
Common errors
- A tag seems to apply to the wrong files. The selection was larger than you thought. Check what is highlighted before you click a dot.
- A new tag appears when you meant to use an existing one. Tag names are matched by their text. "Invoices" and "Invoice" are different tags. Pick from the suggestions instead of typing the whole name.
- The tag does not show a dot. The tag has no color. Check Get Info, not the file list.
- Tags vanish after copying to a USB drive. The drive is probably formatted as FAT or exFAT. Reformat it as APFS if you control it, or accept that tags will not survive.
- A tag added in an app does not appear in Finder. Some apps write tags only on save. Save the document, then check again.
- A tag was removed from one item but still shows elsewhere. That is correct. Removal is per item.
Summary
Tags are labels stored in file metadata. You apply them from the toolbar, the File and context menus, Get Info, the Save dialog, or by dragging onto the sidebar. You remove them per item by toggling the dot or deleting the name in Get Info. They survive moves and copies on Mac volumes but not on most non-Apple destinations.
Exercise
You tag a folder named "Taxes" with the tag Important. A colleague searches for the tag Important and does not find the PDF files inside the folder. Why, and what is the fix?
Show answer
A tag applies only to the item you tag, not to its contents. The folder carries the tag, but the PDFs do not. Open the folder, select all the PDFs with Command-A, and apply the Important tag to the selection.
Exercise
You copy a tagged file to a USB drive formatted as exFAT, and the tag is gone on the drive. Name the reason and one way to confirm the tag was present before the copy.
Show answer
Tags are stored in extended attributes, which exFAT does not preserve in the same way. To confirm the original had the tag, run mdls -name kMDItemUserTags on the source file, or open its Get Info window and read the Tags field.