Remove PDF Attachments From Multiple Files With Acrobat Action Wizard
Question details
Remove attachments from a large collection of PDFs automatically rather than editing each file individually.

- Product
- Adobe Acrobat Pro
- Device & OS
- not provided
- Scenario
- A PDF library needs to be processed in bulk so attachments do not interfere with indexing.
- Observed behavior
- The PDFs contain attachments that make indexing inconvenient, and removing them one at a time would be time-consuming.
Check that your Acrobat edition includes Action Wizard and that the PDFs can be modified. Test the action on copies of a few representative files, including one with multiple attachments, before processing the full library.
Run an Acrobat Action to remove document-level attachments
Use Action Wizard to apply a JavaScript removal step to PDFs in a folder.
This script removes document-level embedded files. It does not necessarily remove attachments added as page annotations, and it may not work on protected PDFs that prohibit changes.
In Acrobat Pro, open All tools or Tools, select Action Wizard, and choose New Action. Menu names can vary by Acrobat version.
Under More Tools, add Execute JavaScript to the action. Select Specify Settings and enter: while (this.dataObjects && this.dataObjects.length) { this.removeDataObject(this.dataObjects[0].name); }
Add or configure the Save step in the action, choose an output location and naming behavior, and save the action with a descriptive name.
Select the saved action in Action Wizard, add a folder containing test copies, and click Start. Open the resulting PDFs and check the Attachments panel to confirm the document-level attachments are gone.
Once the test results are correct, run the action again and select the folder containing the PDFs to process. Review any errors and confirm the output files before reindexing.

Review PDF files and Office documents with WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface and support for common Microsoft Office formats, making it easy to move between existing documents and PDFs. It does not replace Acrobat Action Wizard for this bulk attachment-removal workflow.

Frequently Asked Questions
Can Acrobat process an entire folder of PDFs?
Yes. In Acrobat Pro, open Action Wizard, select your saved action, and add a folder before clicking Start. Check the action's save settings before running it.
Will this script remove every kind of PDF attachment?
It targets document-level embedded files exposed through Acrobat's dataObjects collection. Attachments added as page annotations may need separate handling.
Can I run the action on password-protected PDFs?
The PDFs must permit the changes. Open a representative file in Acrobat and check its security settings; restricted files may need to be unlocked or processed with appropriate permissions first.
How can I check that the attachments were removed?
Open a processed PDF in Acrobat and inspect its Attachments panel. Test files with multiple attachments and review any Action Wizard errors before processing the full library.




