This article explains how to remove pages, which do not have any specific labels , in a space 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.
...