Remove metadata from Word (2025): clean DOCX safely
Clean Word metadata (author, company, timestamps, XMP, custom properties) and purge hidden content such as comments and revision history. Includes Document Inspector, PowerShell automation, and ExifTool second-pass checks.
Privacy Risk
Author, company, timestamps
Lossless
Content unchanged
Automation
CLI & scripts
Audit what’s inside a DOCX
A DOCX is a ZIP archive. Core properties live in docProps/core.xml, app data in docProps/app.xml, and custom properties in docProps/custom.xml. Comments and revisions live in the document parts.
# Peek into a copy (do not modify originals) cp "doc.docx" "copy.docx" && unzip -l "copy.docx" | sed -n '1,40p' # Extract properties for inspection unzip -p "copy.docx" docProps/core.xml | xmllint --format - unzip -p "copy.docx" docProps/custom.xml | xmllint --format -
Remove via Document Inspector (GUI)
File → Info → Check for Issues → Inspect Document
Remove All selected categories
- Open the DOCX → File → Info → Check for Issues → Inspect Document.
- Select: Document Properties and Personal Information, Comments, Revisions, Hidden Text, etc.
- Click Remove All for each found item → Save As a clean copy.
PowerShell automation (Windows)
# Clear core & custom properties and remove comments/accept revisions
# Requires Word installed on the machine (COM automation)
$path = "C:\docs\input.docx"
$word = New-Object -ComObject Word.Application
$word.Visible = $false
$doc = $word.Documents.Open($path)
# Accept revisions & delete comments (optional but recommended)
$doc.AcceptAllRevisions()
foreach ($c in @($doc.Comments)) { $c.Delete() }
# Clear built-in properties
$props = $doc.BuiltInDocumentProperties
$props.Item("Author").Value = ""
$props.Item("Last Author").Value = ""
$props.Item("Company").Value = ""
$props.Item("Manager").Value = ""
$props.Item("Category").Value = ""
$props.Item("Keywords").Value = ""
$props.Item("Comments").Value = ""
$props.Item("Title").Value = ""
$props.Item("Subject").Value = ""
# Clear custom properties
$custom = $doc.CustomDocumentProperties
for ($i = $custom.Count; $i -ge 1; $i--) { $custom.Item($i).Delete() }
# Save as new file
$out = "C:\docs\clean.docx"
$doc.SaveAs([ref]$out)
$doc.Close()
$word.Quit()ExifTool: clear core/custom properties
ExifTool can read/write many OOXML properties inside DOCX. Use it as a second pass after Document Inspector to ensure fields are blank.
# Clear common properties exiftool -Title= -Subject= -Author= -Creator= -Company= -Manager= -Keywords= -Comments= -Category= -LastModifiedBy= -overwrite_original "doc.docx" # Clear custom properties too exiftool -XMP:All= -overwrite_original "doc.docx" # Recursive folder cleanup (properties only) exiftool -Title= -Subject= -Author= -Creator= -Company= -Manager= -Keywords= -Comments= -Category= -LastModifiedBy= -overwrite_original -r "./docs"
Tracked changes & comments
Accept all changes
Finalize content
Delete comments
Resolve or remove
Embedded images (EXIF/GPS)
Photos inside a DOCX can retain EXIF/GPS. Clean images before embedding, or extract/replace them in the final document.
# Clean an image before inserting into Word exiftool -all= -tagsFromFile @ -icc_profile -overwrite_original "photo.jpg"
Verify cleanup
# Inside Word: File → Info — verify Properties fields are blank # CLI cross-check with ExifTool: exiftool -G -a -s "clean.docx" | egrep -i "Title|Author|Company|Manager|Keywords|Subject|LastModifiedBy|XMP" || echo "Common fields clear" # Optional: unpack and view XML unzip -p "clean.docx" docProps/core.xml | xmllint --format - unzip -p "clean.docx" docProps/custom.xml | xmllint --format -
CI/Batch workflows
name: scrub-docx
on:
push:
paths: ["docs/**/*.docx"]
jobs:
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install exiftool
run: sudo apt-get update && sudo apt-get install -y exiftool
- name: Clear properties
run: |
exiftool -Title= -Subject= -Author= -Creator= -Company= -Manager= -Keywords= -Comments= -Category= -LastModifiedBy= -overwrite_original -r docs/
- name: Audit
run: |
for f in $(git ls-files "docs/**/*.docx"); do
exiftool -G -a -s "$f" | egrep -i "Title|Author|Company|Manager|Keywords|Subject|LastModifiedBy|XMP" || echo "Clean: $f"
doneFAQ
Publish clean Word files — protect privacy
Inspect, clean, and verify DOCX metadata. For embedded images, scrub EXIF/GPS first to eliminate location leaks.