Guide

How to Remove Metadata From a PDF on Mac

By the Smol team10 min read

To remove metadata from a PDF on a Mac, run two commands, not one: exiftool -all= file.pdf followed by qpdf --linearize file.pdf clean.pdf. exiftool alone does not delete anything. It appends an update, and a single command puts every tag back.

That is not an edge case or a version quirk. exiftool’s own manual says so, and the tool prints a warning every time you do it. Most instructions for cleaning a PDF stop at the first command.

Three other things survive nearly every tool people reach for: the author names attached to comments and markup, embedded file attachments, and the previous versions left behind by incremental saves. Everything below was measured on 26 September 2026 on a MacBook Pro (M2 Pro, 16 GB) running macOS 27.0 build 26A428, with exiftool 13.50, qpdf 12.3.2 and Ghostscript 10.07.0.

The test document is a synthetic three-page contract. Its pages were printed by headless Chrome; its images come from an Apple system wallpaper; every name, company and date in it was invented. It carries 10 Document Info keys, an XMP packet, three comments from two named reviewers, one attached spreadsheet, and one incremental update.

Which route actually removes it?

Every row was run against the same 162,058-byte fixture. “Recoverable” means a single exiftool -PDF-update:all= put the deleted tags back.

RouteSize afterDoc Info + XMP leftRecoverable?
exiftool -all=157,760 B0 of 10 keys, 0 XMP tagsYes, fully
exiftool -all= then qpdf --linearize155,649 B0 of 10 keys, 0 XMP tagsNo
qpdf --linearize alone160,257 B10 keys, 13 XMP tagsNothing was removed
Ghostscript -sDEVICE=pdfwrite139,864 B8 keys, 14 XMP tagsIt copies your metadata forward
mutool clean -gggg158,752 B10 keys, 13 XMP tagsNothing was removed
Smol, strip metadata157,760 B0 of 10 keys, 0 XMP tagsYes, fully
Smol compression, Tiny and Medium presets57,377–74,008 B10 keys, 13 XMP tagsNothing was removed

Two rows deserve attention before anything else. Ghostscript looks like a cleaner and is not: it carried Author, Title, Subject, Keywords and Creator straight into its output while stamping its own Producer on top. And compressing the file, in any tool, removed nothing at all.

None of the seven routes touched the comment authors or the embedded attachment. That is a separate job, covered further down.

What counts as metadata in a PDF?

A PDF keeps identifying information in five places, and tools differ wildly in how many of them they know about.

Where it livesWhat is in itWho removes it
Document Information dictionaryTitle, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate, and whatever else the producer added. Word writes /Company. Our fixture had 10 keys.Most metadata tools
XMP packetAn XML block duplicating most of the above, plus xmpMM:DocumentID and InstanceID, which track a document across revisions and copies.Most metadata tools
Incremental update historyEvery previous version of the two blocks above, left in the file when a PDF is saved by appending rather than rewriting.Almost nothing
Annotation dictionariesThe /T key on each comment, sticky note, highlight and signature. It holds the name of the person who made it.Nothing, automatically
Embedded file attachmentsWhole files carried inside the PDF, with their own filenames and descriptions.Nothing, automatically

There is a reading trap before you even start. exiftool hides Document Info entries that duplicate an XMP tag of the same name. On the fixture, the default output listed 11 PDF-group tags. Adding -a listed 15. Title, Subject, Creator and Producer were sitting in the Document Info dictionary the whole time, invisible.

# what you think you have
exiftool document.pdf

# what is actually in the file
exiftool -a -G1 document.pdf

Always use the second one when you are checking your work.

Why does exiftool leave the old metadata in the file?

Because it never deletes anything from a PDF. It writes an incremental update: a block appended to the end of the file saying “ignore the old metadata object.” The old object is still there.

From exiftool 13.50’s manual, under Writing Notes:

3) Changes to PDF files by ExifTool are reversible (by deleting the
update with "-PDF-update:all=") because the original information is
never actually deleted from the file.  So ExifTool alone may not be
used to securely edit metadata in PDF files.

It also tells you at the time. Run exiftool -all= on any PDF and you get Warning: [minor] ExifTool PDF edits are reversible. Deleted tags may be recovered!

Here is what that means with real numbers. Starting from the cleaned file:

StepDoc Info keysXMP tagsAuthor reads
Original fixture1013Cleared For Sending
exiftool -all=00(nothing)
then exiftool -PDF-update:all=1012Fixture Author

Company, Keywords, Title and the XMP creator came back with it. One command, no forensics tooling, no hex editor. Searching the raw bytes of the supposedly cleaned file still found the original author string twice and the original word processor name twice.

A warning about the obvious fix. Putting both flags in one command does not work, and it fails in the worst possible direction:

# WRONG — this reverts your deletion instead of finishing it
exiftool -overwrite_original -all= -PDF-update:all= document.pdf

That produced a 157,239-byte file with all 10 Document Info keys and 12 XMP tags present. It undid the strip. Running the two as separate passes leaves you back where you started, reversible again, because the second pass is itself an incremental update.

What actually removes PDF metadata for good?

Delete the tags, then rewrite the file from scratch so the orphaned objects are never copied over. qpdf does the rewrite, and it ships with Homebrew.

brew install exiftool qpdf

exiftool -overwrite_original -all= document.pdf
qpdf --linearize document.pdf document-clean.pdf

On the fixture, the result was 155,649 bytes and it held up:

  • Document Info: 0 of 10 keys. XMP: 0 of 13 tags.
  • exiftool -PDF-update:all= returned "Error: File contains no previous ExifTool update".
  • Searching the raw bytes for the original author, company and authoring-tool strings returned nothing.
  • All three pages intact, both page images intact.

Order matters. Running qpdf --linearize first and exiftool second gets you back to a reversible file. Strip, then rewrite.

If you would rather not install two tools, the same idea works with any program that genuinely rebuilds the PDF rather than appending to it. What you cannot do is trust a tool that only edits.

Do Ghostscript or mutool help?

Ghostscript is the wrong tool for this, and it is wrong in a way that is easy to miss. It rebuilds the file, which kills the update history, then faithfully copies your Document Info into the new one and regenerates an XMP packet to match.

TagBeforeAfter Ghostscript 10.07.0
AuthorCleared For SendingCleared For Sending
TitleAgreement (final)Agreement (final)
SubjectSynthetic fixture for a metadata test.unchanged
Keywordsfixture; metadata; test; confidentialunchanged
CreatorFixture Word Processor 3.2unchanged
ProducerFixture Producer 1.0GPL Ghostscript 10.07.0
XMP tags1314

It did make the file smaller, 162,058 down to 139,864 bytes. It is a compressor that happens to reset the Producer string. Use it for size, not for privacy.

mutool is a structural cleaner and behaves like one: mutool clean -gggg produced 158,752 bytes with all 10 Document Info keys and 13 XMP tags untouched. Adding -d to decompress the streams took the same file to 7,386,275 bytes, forty-five times the original, and still removed no metadata. Both are the right tools for other jobs.

What about comment authors and attached files?

Nothing in the table removed these. All seven routes, including the two that genuinely cleaned the Document Info dictionary, left three annotations carrying two reviewer names and one embedded spreadsheet with its description intact.

This is the part that matters most for a document going to the other side of a negotiation. A comment author name is not metadata in the Document Info sense, it is document content, and metadata tools do not touch document content. Neither does grep: the fixture’s reviewer names sat inside a compressed object stream, so searching the raw bytes found nothing while every PDF reader could display them.

Check before you send:

# list attachments
qpdf --list-attachments document.pdf

# remove them
qpdf --remove-attachment=fee-breakdown.csv document.pdf out.pdf

For the annotations, Preview can do it by hand. Open the markup sidebar, delete every comment and note, then save. That is fine for a handful and painful for a hundred. If you are dealing with review copies routinely, flattening the file is the reliable move: print to PDF, or export a flattened copy from whatever produced it, which converts markup into page content and leaves nobody’s name attached to anything.

Redaction is a third thing again, and neither this article nor any metadata tool addresses it. Drawing a black box over a name in Preview does not delete the text underneath.

Does compressing the PDF strip its metadata?

No, and the result is close to the opposite of what people expect. We put the fixture through our own compression presets and measured what came out:

PresetSizeReductionDoc Info + XMPUpdate history
Tiny57,377 B64.6%All 10 keys, all 13 XMP tagsCollapsed
Medium74,008 B54.3%All 10 keys, all 13 XMP tagsCollapsed
Strip metadata (separate operation)157,760 B2.7%Nothing leftStill there

Compression rebuilds the file, so it does throw away the previous versions. It also carries every current tag, annotation author and attachment into the new file. Stripping does the exact inverse: it clears the tags and leaves the history. Neither one is a complete clean on its own, which is why the two-command recipe above exists.

Our PDF presets are pixel caps rather than metadata operations, and what each preset actually does goes through the measurements. The broader version of this question, across images, video and audio, is in does compressing a file remove its metadata.

When Smol is not the answer

For a single document, exiftool -all= plus qpdf --linearize is free, takes about a second, and is strictly better than what we ship. We are not going to pretend otherwise, and the measurement says so plainly: our strip-metadata output on this PDF was byte-for-byte identical to exiftool -all=, SHA-256 and all. Run smol_doctor through the app’s tool surface and exiftool is right there in the bundled binary list.

Which means we inherit the flaw. Our strip output on the fixture was reversible by the same one-line command, and we do not run the qpdf rewrite afterwards even though qpdf is also bundled. If you are cleaning a document because the recipient must not learn who wrote it, add the qpdf pass yourself.

One more unflattering number. On a document with no prior update history, stripping made the file larger: 157,239 bytes in, 157,760 out, a 521-byte increase, and the app reported it as −0.3% savings. Rewriting a cross-reference table costs a little.

Where we do earn the money:

  • A folder of sixty review copies, dropped in at once, with the originals left alone automatically.
  • Mixed piles where the PDFs sit next to photos and screenshots and you want one pass over all of it.
  • A Finder right-click or a watched folder instead of a command somebody has to remember correctly.
  • Colleagues in legal or HR who are never going to install Homebrew.

And two cases where nothing on this page is right. If you need a defensible audit trail for disclosure, you want a forensics workflow with hashes at every step and a written procedure, not a drop target. If you need redaction, you need a redaction tool, because removing metadata does nothing about the name in paragraph four.

Smol is $29 once. The related jobs are covered in compressing a PDF on Mac, batch-stripping a whole folder, and our help article on removing EXIF and GPS data.

Frequently asked questions

How do I remove metadata from a PDF on Mac?

Run two commands. First exiftool -overwrite_original -all= document.pdf to clear the Document Information dictionary and the XMP packet, then qpdf --linearize document.pdf clean.pdf to rewrite the file so the deleted objects are not copied across. exiftool alone is not enough: it appends an update rather than deleting, and the old metadata stays in the file.

Why does exiftool say PDF edits are reversible?

Because they are. exiftool writes changes to a PDF as an incremental update appended to the end of the file, leaving the original objects in place. Its manual states that ExifTool alone may not be used to securely edit metadata in PDF files. In testing, exiftool -PDF-update:all= restored all 10 Document Info keys and 12 XMP tags to a file that had been cleaned moments earlier.

Does compressing a PDF remove its metadata?

No. Compressing our test document at the Tiny preset took it from 162,058 to 57,377 bytes, a 64.6% reduction, and every Document Info key, every XMP tag, all three comment authors and the embedded attachment survived. Compression does collapse the incremental-update history as a side effect, but it removes no current metadata at all.

Does Ghostscript remove PDF metadata?

No. Running the fixture through Ghostscript 10.07.0 with -sDEVICE=pdfwrite made it smaller, 162,058 down to 139,864 bytes, and copied Author, Title, Subject, Keywords and Creator into the output unchanged while replacing only the Producer string with its own. It is a compressor, not a metadata cleaner.

Do comment authors and attachments get removed with the metadata?

No. All seven tools tested left three annotations carrying two reviewer names and one embedded spreadsheet intact. Annotation author names live in the /T key of each annotation and count as document content, not metadata. Use qpdf --list-attachments to find attachments and qpdf --remove-attachment to delete them, and delete or flatten annotations separately.

Does removing metadata redact the text in a PDF?

No, and conflating the two is how documents leak. Metadata removal clears authorship and tool information stored alongside the pages. Redaction removes words from the pages themselves. Drawing a black rectangle over a name in Preview leaves the underlying text selectable and searchable, and no metadata tool will fix that.

Keep reading