Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to remove pages, which do not have any specific labels, using Confluence Command Line Interface (CLI).

Instructions

Use runFromPageList action to run actions for each page from a page list and use removePage to remove pages that do not have specific labels based on CQL

  1. Ensure that the CLI client file is updated with the required information. 

    Here is a screenshot of a sample space with pages and labels added to them. Page5 and page6 have label2 and label3 respectively.


    Image RemovedImage Added

  2. Run the below CLI action which will remove the pages that do not have a specific label. In this example it is label1.

    Code Block
    themeMidnight
    --action runFromPageList --cql "space = "JSON" and label not in (\"label1\")" --common "-a removePage --id @pageId@"
    

    The output of the CLI action:

    Code Block
    themeMidnight
    Run: -a removePage --id 30310402
    Removed page 'page5' in space JSON.
    
    Run: -a removePage --id 30310404
    Removed page 'page6' in space JSON.
    
    Run completed successfully. 2 actions were successful 

...