Bulk Delete Comments

Using this script, you can automatically delete comments from a space or certain pages. When you run the script, you can choose to delete all comments (including inline comments) or certain comments based on age.  

This script is useful to use when comments become irrelevant because of their age.

If the comment has been modified, the age refers to the modified date not the creation date.

Run the script

To run this script, follow these steps: 

  1. Navigate to General Configuration > ScriptRunner > Built-In Scripts
  2. Select Bulk Delete Comments
  3. Enter the space you want to work with in Space
  4. When Page Tree(s) appears, you can select specific pages within the space to work with, or you can select the entire space.
  5. Select the Comment Age of items to be deleted. The Preset Filters are:

    • Older Than 6 Months

    • Older Than 1 Year

    • Older Than 2 Years
    • Created Within Last Month

    • All

    • A Custom Filter. Your choices are:

      • Created within the last
        Created Within the Last appears, where you can enter a number and Days, Weeks, Months, or Years to determine the age of attachments to delete.
      • Older than
        Older Than 
        appears, where you can enter a number and Days, Weeks, Months, or Years to determine the age of attachments to delete.
      • Created Between Range
        Created between/range appears where you can select two dates to determine the age of attachments to delete.
  6. Select whether you want to send Notifications for this update. If you check the box, updates will go to all users who watch the page.
  7. Select Run.
    The blank form.
    You can select Preview instead of Run to view changes before implementing them.

Results

Once you select Run, a list of the deleted comments appears: 

An example of results from the script.

Examples

You can use the Bulk Delete Comments script in the following situations: 

  • When comments become irrelevant due to content changes, delete comments after the date of the last change.
  • When storage space is limited and comments are not being tracked and are irrelevant, delete older than 6 months.
  • When a space comment policy is updated, delete recorded comments.
On this page