everyday mac tools

Remove metadata from a PDF on a Mac before you share it

· 6 min read

The fastest way to strip a PDF’s metadata on a Mac is to print it to a new PDF: File, Print, then Save as PDF from the PDF menu at the bottom left, clearing the Title, Author, Subject and Keywords fields in the save sheet. That writes a fresh file with only what you typed. It also flattens annotations and drops attachments and bookmarks, which is usually what you want before sharing and occasionally not.

Below: what a PDF carries, how to read it, how to remove it with macOS alone, and the pieces that route does not touch.

What a PDF says about you

Two kinds of metadata live inside the file.

The document information fields: title, author, subject, keywords, the application that created the document, the application that produced the PDF, and creation and modification dates. Word processors fill these in from your account name and the original filename, so “Untitled 4” and your full name are common.

An XMP block: a chunk of XML that many producers add alongside the same fields, sometimes with a document identifier and an edit history that persists across saves.

Then there is everything that is not strictly metadata but behaves like it. Comments and notes carry the name of whoever added them. Form fields hold values. Bookmarks hold headings from an earlier draft. Attached files hold whatever was attached. Some producers embed a thumbnail image of each page that is not regenerated when the page changes. What a PDF still hides goes through those.

And outside the file: the filename, which travels with it, and the extended attributes macOS keeps on your copy, including where it was downloaded from.

Read it first

Three views, from quickest to most complete.

Finder. Select the file, press Command-I, and open More Info. Title, authors, page count and the encoding software appear if Spotlight has indexed the file.

Preview. Open the PDF, then Tools, Show Inspector (Command-I). The general pane lists the document fields; another pane lists the annotations on each page.

Terminal. This is the one that shows the most.

mdls ~/Desktop/report.pdf

Look at kMDItemAuthors, kMDItemTitle, kMDItemCreator, kMDItemEncodingApplications, kMDItemWhereFroms and the dates. kMDItemWhereFroms is the download URL macOS recorded when the file arrived, which nobody expects to be there.

Preview’s Inspector shows these fields but does not let you edit them. Exporting from Preview (File, Export) keeps them. Preview is a reader of metadata, not a remover.

Remove it with the Print dialog

This is the macOS-only route and it works on any version from Ventura on.

  1. Open the PDF in Preview.
  2. File, Print (Command-P).
  3. At the bottom left of the print sheet, open the PDF pop-up menu and choose Save as PDF.
  4. In the save sheet, look at the Title, Author, Subject and Keywords fields. Clear them, or set them to what you are happy to publish. The Author field is pre-filled from your contact card, so it is your name unless you remove it.
  5. Save under a new name.

The result is a new PDF drawn by macOS from the rendered pages. Text stays selectable, images are re-encoded, and the fields contain only what you typed. Annotations are baked into the page as drawn (a sticky note becomes its icon, a highlight becomes a colored box, comments lose their author). Bookmarks, attachments, form interactivity and layers do not survive, because the print path never sees them.

That last paragraph is the trade. For a document you are sending to be read, it is a good trade. For a form someone needs to fill, or a long document where the bookmarks matter, it is not; see the section on what this route misses.

Rename the file and clear the extended attributes

Two things outside the PDF.

The filename. “Smith_settlement_FINAL_v7_do_not_send.pdf” is metadata. Rename to something you would be content to see quoted.

Extended attributes. macOS attaches data to files on your disk: the download source, the quarantine flag, Finder tags and comments. Most of it does not travel by email, but it does travel by AirDrop, in some archives, and on a USB drive formatted for Mac. To see what your copy carries:

xattr -l ~/Desktop/report.pdf

To clear all of it:

xattr -c ~/Desktop/report.pdf

That removes the attributes from that file only; nothing inside the PDF changes.

What the Print route misses

Printing to PDF re-draws pages. Anything that lives outside the page drawing is simply absent from the output, which is good for privacy and bad if you needed it. It does not remove things from the original file, so if you accidentally share the original you are back where you started.

It also does not help when the document has to keep its structure: fillable forms, bookmarks for a long report, attachments that are part of the record, or a scanned document whose OCR text layer you want to keep searchable. For those you need a tool that edits the PDF’s objects rather than re-rendering the pages.

If you handle documents like that regularly, Basalt has an Inspect tool that lists what a PDF still hides, and a Clean Up tool for layers, bookmarks and attachments, writing a new file each time and leaving the original alone. Its redaction strips metadata, XMP, attachments, hidden layers and stale thumbnails as part of the same pass, which is the reason to redact and clean in one step rather than two.

Check the result

Do not assume. On the new file:

  1. mdls in Terminal, and read the author, title, creator and where-from lines.
  2. Tools, Show Inspector in Preview: fields and annotations.
  3. Select a page, Command-A, Command-C, paste into TextEdit, and confirm the text you expect is still there and the text you do not is not.

How to check whether a PDF was really redacted runs through the same checks in more depth; they apply to any file you are about to send.

Questions

Does emailing a PDF strip its metadata? No. Mail attaches the file as it is. Some services re-save uploaded documents and change them, but you should not rely on that, and it does not apply to attachments.

Is a screenshot of each page cleaner? Cleaner, and useless. Screenshots contain no text, so the recipient cannot search or select anything, and the images carry their own creation dates. Print to PDF keeps the text and is just as free of the original fields.

Why does the Author field keep coming back with my name? The save sheet fills it from the card marked as yours in Contacts. Clear it each time, or change what the card says. Word processors fill their own author field from the account name in the app’s settings, which is a separate place to look.

Can Preview edit the title or author directly? No. The Inspector displays them and that is all. The Print route replaces them; anything more precise needs a PDF tool that edits the document fields in place.