
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
cloudflare-bulk-delete
Advanced tools
Fix Cloudflare 'too many deployments to be deleted' error. Bulk delete Pages and Workers deployments safely.
The fastest way to bulk delete Cloudflare Pages and Workers deployments.
When Cloudflare shows "Your project has too many deployments to be deleted, follow this guide to delete them", this tool solves it in minutes instead of hours.
Cloudflare Pages can fail to delete projects with a large deployment history. Cloudflare documents a Wrangler-based workaround; this tool automates the same cleanup problem with filtering, dry runs, and safety controls for Pages and Workers.
Before: Hours of manual API calls After: 3 commands, done in minutes
$ cf-bulk-delete interactive
✓ API connections successfully validated
=== Cloudflare Pages Projects ===
1. my-blog-site (247 deployments)
2. portfolio-app (156 deployments)
3. docs-site (89 deployments)
? Select resource to manage: my-blog-site
✓ Found 247/247 deployments for my-blog-site
? Choose action: Bulk delete deployments
? Select protection mode: Safe Mode (Recommended)
Preview: Will delete 245 deployments (keeping latest 2, skipping production)
? Proceed with deletion? Yes
⠋ Deleting deployments... 89/245 completed
✓ Cleanup completed: 245 succeeded, 0 failed
Duration: 2.3s | Rate: 106.5/s
Problem solved! 🎉
Cloudflare Dashboard Error:
❌ "Your project has too many deployments to be deleted, follow this guide to delete them: https://cfl.re/3CXesln"
Our Solution:
✅
cf-bulk-delete interactive- Delete hundreds of deployments in seconds
# 1. Install
npm install -g cloudflare-bulk-delete
# 2. Create a token from the pre-filled Cloudflare template:
# https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22page%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_scripts%22%2C%22type%22%3A%22edit%22%7D%5D&accountId=%2A&zoneId=all&name=Cloudflare+Bulk+Delete
# 3. Set your credentials
export CLOUDFLARE_API_TOKEN=your_token_here
export CLOUDFLARE_ACCOUNT_ID=your_account_id_here
# 4. Clean up deployments
cf-bulk-delete interactive
# npm
npm install -g cloudflare-bulk-delete
# pnpm
pnpm add -g cloudflare-bulk-delete
# Bun
bun add -g cloudflare-bulk-delete
Requires Node.js 22.14 or newer. The repository includes npm, pnpm, and Bun lockfiles for local verification.
The VS Code extension package lives in vscode/. It has no os or cpu restriction, so one VSIX can be used across VS Code desktop and remote extension hosts that support Node-based extensions.
# Build a local VSIX from the repo root
npm run vscode:package
# Install locally for testing
code --install-extension vscode/cloudflare-bulk-delete-vscode-*.vsix
Publishing is manual. There is no GitHub Actions workflow, Dependabot config, git hook, npm lifecycle publish guard, or release workflow in this repository.
Use the pre-filled token template:
Or configure token permissions manually:
Save Your Token:
Option A: Export in Terminal (Temporary)
export CLOUDFLARE_API_TOKEN=your_token_here
export CLOUDFLARE_ACCOUNT_ID=your_account_id_here
Option B: Create .env File (Recommended)
# Create .env file in your project directory
echo "CLOUDFLARE_API_TOKEN=your_token_here" > .env
echo "CLOUDFLARE_ACCOUNT_ID=your_account_id_here" >> .env
Option C: Add to Shell Profile (Permanent)
# Add to ~/.bashrc, ~/.zshrc, or equivalent
echo 'export CLOUDFLARE_API_TOKEN=your_token_here' >> ~/.bashrc
echo 'export CLOUDFLARE_ACCOUNT_ID=your_account_id_here' >> ~/.bashrc
source ~/.bashrc
cf-bulk-delete interactive
Choose your resources, select protection level, confirm deletion.
# List all resources
cf-bulk-delete list
# Preview cleanup (safe)
cf-bulk-delete delete pages my-project --max-age 30 --dry-run
# Execute cleanup
cf-bulk-delete delete pages my-project --max-age 30
# Clean old preview deployments only
cf-bulk-delete delete pages my-project --environment preview --max-age 7
# Core commands
cf-bulk-delete list # List all resources
cf-bulk-delete deployments pages my-project # Show deployments
cf-bulk-delete delete pages my-project # Bulk delete
cf-bulk-delete interactive # Interactive mode
cf-bulk-delete token-template # Show API token template link
# Options
--dry-run # Preview only
--max-age <days> # Delete older than X days
--environment <env> # Target specific environment
--skip-production # Skip production (default: true, use "false" to include production)
--keep-latest <n> # Keep newest N Pages deployments protected (default: 1)
--batch-size <n> # Process in batches (default: 10)
--force # Force delete aliased deployments (default: true)
--no-force # Disable force mode for aliased deployments
Emergency cleanup (keeps production safe):
cf-bulk-delete delete pages my-project --max-age 7 --dry-run
cf-bulk-delete delete pages my-project --max-age 7
Clean only preview deployments:
cf-bulk-delete delete pages my-project --environment preview --max-age 1
Workers version cleanup:
cf-bulk-delete delete workers my-script --max-age 30
import { ServiceManager } from 'cloudflare-bulk-delete';
const manager = new ServiceManager(apiToken, accountId);
// Get deployments
const deployments = await manager.listDeployments('pages', 'my-project');
// Bulk delete
const result = await manager.bulkDeleteDeployments('pages', 'my-project', deployments, {
skipProduction: true,
dryRun: false
});
console.log(`Deleted: ${result.success}, Failed: ${result.failed}`);
"Invalid API Token"
Account > Pages > WriteAccount > Workers Scripts > WriteCloudflare Pages Edit and Workers Scripts Edit.cf-bulk-delete token-template"Cannot delete an aliased deployment"
Error: You cannot delete an aliased deployment without a `?force=true` parameter
force=true by default--no-force flag"Too Many Requests"
--batch-size 5"Account ID not found"
Debug mode:
LOG_LEVEL=debug cf-bulk-delete list
MIT License - see LICENSE
Solves: Cloudflare "too many deployments to be deleted" error
Author: Rama Aditya
Repository: https://github.com/RamaAditya49/cloudflare-bulk-delete
FAQs
Fix Cloudflare 'too many deployments to be deleted' error. Bulk delete Pages and Workers deployments safely.
We found that cloudflare-bulk-delete demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.