How to Unlock Acrobat Comment Text Tools Using JavaScript
Question details
The user needs a method to unlock text commenting tools or annotations in Adobe Acrobat so they can be freely edited.

- Product
- Adobe Acrobat
- Device & OS
- Windows / macOS
- Scenario
- Reviewing or editing a PDF document where the author has restricted modifications to text comments and annotations.
- Observed behavior
- The commenting text tool is locked, preventing the user from moving, modifying, or deleting the selected text annotations.
Ensure you have the necessary document permissions to modify the PDF file, and verify that JavaScript execution is enabled in your Adobe Acrobat preferences.
Use the Acrobat JavaScript Console to Batch Unlock
Execute a short script via the JavaScript console to instantly remove the lock and read-only status from all annotations in the PDF.
This method is highly efficient if a document contains multiple locked text comments, as it uses an automated script to loop through and unlock every annotation on the page.
Press Ctrl + J on Windows or Command + J on macOS to open the interactive JavaScript debugger console in Adobe Acrobat.
Click into the console input area and paste the following script: syncAnnotScan(); var annots = getAnnots(); for (var i = 0; i < annots.length; i++) { annots[i].lock = false; annots[i].readOnly = false; }
Highlight the entire block of code you just pasted, then press Ctrl + Enter on Windows (or Command + Return on macOS) to execute the script.

Manage PDF Comments Effortlessly with WPS Office
If dealing with scripts and locked interfaces in Acrobat is slowing you down, try WPS Office. It provides an intuitive, lightweight PDF editor that makes adding, editing, and managing comments completely hassle-free without the need for complex workarounds.
- 1. Open your PDF in WPS: Launch WPS Office and open your PDF document. The software automatically recognizes existing text tools and annotations.
- 2. Navigate to the Comment Tab: Click on the 'Comment' tab on the top ribbon to access the full suite of annotation and text editing tools.
- 3. Edit Comments Directly: Click on any text comment to instantly modify, move, or delete it using the intuitive properties panel on the right.

Frequently Asked Questions
Can I unlock a single PDF comment without using JavaScript?
Yes. If the document isn't globally restricted by a password, you can right-click the specific comment, choose 'Properties', and uncheck the 'Locked' option at the bottom of the dialog box.
Why are my PDF comments locked by default?
Comments are often locked by the original document author to prevent accidental changes, deletions, or shifts in formatting during the document review process.
What should I do if the JavaScript console is disabled in Acrobat?
If your security settings prevent the console from opening, navigate to Edit > Preferences > JavaScript and ensure the 'Enable Acrobat JavaScript' checkbox is selected before trying again.
Does this JavaScript remove password protection from the whole PDF?
No. This script only alters the 'lock' and 'readOnly' properties of existing annotations (like text boxes and sticky notes). It cannot bypass document-level encryption or owner passwords.




