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.
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.Run the below CLI action which will remove the pages that do not have a specific label. In this example it is label1.
--action runFromPageList --cql "space = "JSON" and label not in ("label1")" --common "-a removePage --id @pageId@"
The output of the CLI action:
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
The parameters used with the above action are: