Answers.Body: <p>The API Explorer will only delete one at a time, unfortunately.</p>
  
  <p>If you have command-line access, <code>cv</code> is a nice way to access the API to do this.  You can run a command line:
  <code>cv api Campaign.delete id=1</code>.</p>
  
  <p>Sometimes if I'm feeling lazy and I don't want to code something to mass delete, I'll do the following:</p>
  
  <ul>
  <li>Open a spreadsheet program.</li>
  <li>In column A, start filling in numbers: 1, 2, 3.</li>
  <li>Select those cells and then drag.  LibreOffice Calc, Google Sheets and Excel all know that you want to continue the series.  Continue until you have however many rows you need (in your case, over 500).</li>
  <li>In Cell B1, put the following formula:</li>
  </ul>
  
  <pre><code>="cv api Campaign.delete id=" &amp; A1
  </code></pre>
  
  <ul>
  <li>Copy/paste that down all of column B.  The end result is that you'll have 500+ lines that will each delete a single campaign.</li>
  <li>Copy Column B, then paste it into a command line terminal.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-25T04:09:41.620Z
Answers.Text: Brilliant! Worked perfectly. In my case I used drush cvapi because cv api didn't work. but I did the whole spreadsheet thing and worked amazing. Thanks!
Answers.UserDisplayName: Yossi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-25T02:55:34.390Z
Answers.LastActivityDate: 2019-09-25T02:55:34.390Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>Yes, you can do that with chaining in API Explorer:</p>
  
  <p><a href="https://i.sstatic.net/Wp4C3.png" rel="noreferrer"><img src="https://i.sstatic.net/Wp4C3.png" alt="enter image description here"></a></p>
  
  <pre><code>$result = civicrm_api3('Campaign', 'get', [
    'sequential' =&gt; 1,
    'options' =&gt; ['limit' =&gt; 0],
    'api.Campaign.delete' =&gt; ['id' =&gt; "\$value.id"],
  ]);
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-25T09:16:36.910Z
Answers.LastActivityDate: 2019-09-25T09:16:36.910Z
Answers.UserDisplayName: Aidan
Body: <p>How can I delete all CiviCRM Campaigns without having to delete one at a time? 
  I have over 500 of them. 
  Is there a way to do this with the API explorer?</p>
  
Tags: <civicampaign>
Title: How can I delete all CiviCRM Campaigns?
ThreadText: # How can I delete all CiviCRM Campaigns?
  
  (Asked by: username_0 on 2019-09-24)
  
  How can I delete all CiviCRM Campaigns without having to delete one at a time?
  I have over 500 of them.
  Is there a way to do this with the API explorer?
  
  **Tags:** civicampaign
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-09-25. Score: 5 | Accepted answer
  
  Yes, you can do that with chaining in API Explorer:
  
  $result = civicrm_api3('Campaign', 'get', [
    'sequential' => 1,
    'options' => ['limit' => 0],
    'api.Campaign.delete' => ['id' => "\$value.id"],
  ]);
  
  
  ---
  
  ### Answer by username_1 on 2019-09-25. Score: 2
  
  The API Explorer will only delete one at a time, unfortunately.
  If you have command-line access, cv is a nice way to access the API to do this.  You can run a command line:
  cv api Campaign.delete id=1.
  Sometimes if I'm feeling lazy and I don't want to code something to mass delete, I'll do the following:
  
  Open a spreadsheet program.
  In column A, start filling in numbers: 1, 2, 3.
  Select those cells and then drag.  LibreOffice Calc, Google Sheets and Excel all know that you want to continue the series.  Continue until you have however many rows you need (in your case, over 500).
  In Cell B1, put the following formula:
  
  ="cv api Campaign.delete id=" & A1
  
  
  Copy/paste that down all of column B.  The end result is that you'll have 500+ lines that will each delete a single campaign.
  Copy Column B, then paste it into a command line terminal.
  
  > **Comments:**
  > **username_0**: Brilliant! Worked perfectly. In my case I used drush cvapi because cv api didn't work. but I did the whole spreadsheet thing and worked amazing. Thanks!  
  
  ---
  
  