---
title: "How to remove pages with no specific labels using Confluence CLI"
canonical: "https://support.appfire.com/space/SUPPORT/89133038/How%20to%20remove%20pages%20with%20no%20specific%20labels%20using%20Confluence%20CLI"
format: markdown
---
<span style="color: #000000">This article explains how to remove pages that do not have specific labels using </span>*<span style="color: #000000">Confluence Command Line Interface (CLI)</span>*<span style="color: #000000">.</span>

Instructions

<span style="color: #000000">Use</span><span style="color: #091e42"> </span>[**<span style="color: #091e42">runFromPageList</span>**](https://appfire.atlassian.net/wiki/spaces/CSOAP/pages/68458067/runFromPageList)<span style="color: #000000"> to run actions for each page from a list of pages and use</span> [**<span style="color: #091e42">removePage</span>**](https://appfire.atlassian.net/wiki/spaces/CSOAP/pages/68457939/removePage)<span style="color: #000000">** **</span><span style="color: #000000">to remove pages that do not have specific labels based on CQL. </span>

<span style="color: #000000">For this example, consider a sample space with pages and labels added to them; where pages, </span>*<span style="color: #000000">page5</span>*<span style="color: #000000"> and </span>*<span style="color: #000000">page6</span>*<span style="color: #000000">, have labels, </span>*<span style="color: #000000">label2</span>*<span style="color: #000000"> and </span>*<span style="color: #000000">label3</span>*<span style="color: #000000">, respectively. Here, the pages </span>*<span style="color: #000000">page5</span>*<span style="color: #000000"> and </span>*<span style="color: #000000">page6 </span>*<span style="color: #000000">that do not have the label </span>*<span style="color: #000000">label1,</span>*<span style="color: #000000">are removed from the space.</span>

![image](media://b0a893ad-87b3-4087-8bf6-f1b890875058)

![image](media://a2822d34-8944-4da3-af8e-6e0c09d8a07e)

1. <span style="color: #000000">Ensure that the CLI client file is updated with the required information. </span>
2. <span style="color: #000000">Run the following CLI action to remove the pages that do not have the specified label (in this example, </span>*<span style="color: #000000">label1</span>*<span style="color: #000000">):</span>
  <span style="color: #000000">In this example, the output of the CLI action is:</span>
  *<span style="color: #000000">page5</span>*<span style="color: #000000"> and </span>*<span style="color: #000000">page6</span>*<span style="color: #000000"> </span><span style="color: #000000">pages </span><span style="color: #000000">are now deleted from the given space as shown:</span>

<span style="color: #000000">The parameters used with the above action are:</span>

- <span style="color: #000000">--</span>*<span style="color: #000000">cql</span>*<span style="color: #000000"> value refers to CQL content search.</span>
- <span style="color: #000000">--</span>*<span style="color: #000000">id</span>*<span style="color: #000000"> value refers to numeric ID of an item like a page.</span>

> ℹ️ <span style="color: #000000">It is</span><span style="color: #000000"> </span><span style="color: #000000">re</span><span style="color: #000000">commended</span><span style="color: #000000"> to test the command in a non-production environment or run the action with the </span>[*--simulate*](https://appfire.atlassian.net/wiki/spaces/BCLI/pages/65933894/--simulate)* *<span style="color: #000000">parameter to verify the behaviour before deploying.</span>