pdfblah.com

← All guides

How to redact a PDF (really remove the text)

Most "redaction" just draws a black rectangle over the words. The text is still in the file, so anyone can copy it, search it, or move the box aside. Real redaction takes the words out of the PDF. Here is how to do it properly.

Why a black box is not redaction

Drawing a filled box over text only hides it visually. The characters are still in the content stream underneath. Select the area and copy, run pdftotext, or open the file in another viewer and the "redacted" text is right there. Plenty of real leaks have happened exactly this way, in big companies and actual governments.

The color of the overlay changes nothing: black highlighter, white boxes, and blur effects that are just an overlay all leave every word in the file. If it was drawn on top, nothing was removed.

The right way: delete the text, then mark it

Proper redaction removes the words from the PDF itself, so search and copy return nothing. A bar is drawn on top afterward only as a visible mark, over a spot that is already empty. pdfblah does both: it deletes the matched text from the content stream and draws the bar, so the bar never hides text that is still there.

Step by step

  1. Open pdfblah.com and drop in your PDF. It runs a quick check and shows what is inside.
  2. + Add step → Redact. Type the text to remove.
  3. Pick the scope. Redact the first match, every match, or the Nth. You can ignore case, match whole words, or use a regular expression.
  4. Preview for free. You see a bar over each spot, and the change is highlighted, before you download anything.
  5. Download. The words are gone from the file. Verify with copy, Ctrl+F, or pdftotext.

Redact a PDF now

Remove the text for real and see it first. Free while we're testing.

Redact a PDF

Test it after, every time

Whatever tool you used, verify the output before it leaves your hands:

And clear the metadata while you're there

Author names, company, software, and edit history sit in the file's properties, outside the page text, and survive page-level redaction. Strip them in the same pass: add a Metadata step in the workbench, or on the command line pdfblah meta out.pdf final.pdf --strip. The metadata guide shows what your PDF is quietly carrying.

Redact a lot of things at once

To remove every email, card number, IBAN, SSN, or phone number in one click, use the Scrub PII preset instead of typing each one.

Three ways to run this

Same engine, same result. Pick one:

pipx install pdfblah
pdfblah redact in.pdf out.pdf --find "Account 12345"
pdfblah redact in.pdf out.pdf --find "\d{3}-\d{2}-\d{4}" --regex   # every SSN

The local app and CLI are open source and free. See the pdfblah project on GitHub or the guide to running it locally.