Batch Apply XMP Metadata to PDFs in Adobe Acrobat Action Wizard
Question details
Apply the same external XMP metadata to multiple PDF files in a batch.

- Product
- Adobe Acrobat Pro
- Device & OS
- not provided
- Scenario
- Use Acrobat JavaScript and Action Wizard to apply one XMP metadata packet to a collection of PDFs.
- Observed behavior
- Each processed PDF should contain the intended XMP metadata after the action saves it.
Make sure Acrobat Pro has Action Wizard available and that you have a valid XMP file. Check the metadata for document-specific identifiers or properties that should not be copied to every PDF.
Run an Acrobat JavaScript action on the PDF batch
Use this workflow when the same XMP packet should be assigned to each PDF and saved through an Acrobat action.
Acrobat does not provide a simple Action Wizard command for importing an external XMP file into every PDF. Instead, place the XMP content in a JavaScript string and assign it to each document's metadata property.
Replacing the metadata packet can overwrite existing document-level XMP. Test the action on a small set of files first and inspect the results.
Open the XMP file in a text editor and convert its contents into a valid JavaScript string literal. Escape quotation marks, backslashes, and line breaks as needed; do not alter the XML content itself.
In Acrobat Pro, open Tools > Action Wizard, select New Action, and add Execute JavaScript from the available tools.
Open Specify Settings for Execute JavaScript and enter `this.metadata = "PASTE_ESCAPED_XMP_HERE";`, replacing the placeholder with the escaped XMP content. Keep the surrounding JavaScript quotation marks.
Add a Save step to the action, choose the desired save settings, and save the action. Run it from Action Wizard and select the PDF files or folder to process.
Open a processed PDF and choose File > Properties > Additional Metadata to check the metadata. Repeat the check on another file before processing the full batch.

Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface and support for common Office formats, making it easy to move between documents and PDFs. Acrobat is still needed for the Action Wizard JavaScript workflow described above.

Frequently Asked Questions
Can Action Wizard import an XMP file directly into multiple PDFs?
Acrobat does not offer a simple Action Wizard command for that batch import. Add Execute JavaScript to an action and assign the prepared XMP string to each document's metadata instead.
How do I check whether the metadata was applied?
Open a processed PDF in Acrobat and choose File > Properties > Additional Metadata. Inspect the relevant fields and check more than one processed file.
Will this method preserve each PDF's existing XMP metadata?
Not necessarily. Assigning a complete XMP packet can replace existing document-level metadata, so review the packet and test on a small set before running the full batch.
Do pipe characters always need escaping in the XMP string?
No. A pipe character does not normally need escaping in a JavaScript string. Escape characters required by the string syntax, such as quotation marks and backslashes, and check any additional requirements of your particular workflow.




