npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sygnal/wf-cms-purge

v1.0.0

Published

CLI tool to hard-delete all records in Webflow CMS collections

Downloads

170

Readme

WF CMS Purge

A CLI tool to hard-delete all records in designated Webflow CMS collections for a specified site.

Configuration

Typically Webflow CMS Purge is used in the context of a project, alongside development and testing scripts. As such, the configuration is local.

Edit your .gitignore file, if your project is source-controlled, and add .wf-cms-purge to ensure your configuration and API keys are not checked in.

Create a .wf-cms-purge file in your project directory with the following format:

[my-site-1]
WEBFLOW_API_KEY=your_api_key_here

[my-site-2]
WEBFLOW_API_KEY=another_api_key_here

Each section is identified by the site slug (shortName), and must contain a WEBFLOW_API_KEY for accessing that site's data.

Getting Your API Key

  1. Go to your Webflow site settings
  2. Navigate to the Integrations tab
  3. Generate a new API token with appropriate permissions
  4. Copy the token to your .wf-cms-purge config file

Usage

wf-cms-purge <site-slug> <collection-slug>

Example

wf-cms-purge my-site-1 dealerships

Options

  • -c, --config <path> - Specify a custom path to the config file (default: ./.wf-cms-purge)
  • --noprompt - Automatically confirm all prompts
  • --quiet - Suppress non-error output (shows only errors and a final completion message with site/collection)
  • -V, --version - Output the version number
  • -h, --help - Display help information

How It Works

The purge process follows these steps:

1. Validation

  • Verifies the site exists by matching the provided slug
  • Confirms the collection exists within that site
  • Retrieves the site ID and collection ID for subsequent operations

2. Work Report

  • Counts the total number of items in the collection
  • Displays the count and requests user confirmation before proceeding
  • Exits if the user declines or if there are no items to delete

3. Unlink All Other Collections

  • Scans all collections in the site for Reference or Multi-Reference fields pointing to the target collection
  • Identifies required reference fields and prompts the user to make them optional
  • Iterates through every record in collections with references and nulls the fields pointing to the collection being purged
  • Also checks the purge collection itself for self-references
  • Re-publishes already-published items to ensure the field is fully cleared
  • Uses batch operations where possible to minimize API rate-limit issues

4. Purge Collection

  • Bulk unpublishes live items (up to 100 per request)
  • Bulk deletes staged items (up to 100 per request)

Features

  • Rate Limiting: Automatically handles Webflow API rate limits with exponential backoff
  • Error Handling: Comprehensive error handling with detailed error messages
  • Logging: Clear console output showing progress at each step
  • Safety Checks: Multiple confirmation prompts before destructive operations
  • Reference Management: Automatically handles collection references to prevent deletion errors

API Rate Limits

This tool is designed to respect Webflow's API rate limits:

  • Implements a rate limiter to prevent exceeding API quotas
  • Automatically retries failed requests with exponential backoff
  • Processes requests sequentially to avoid overwhelming the API
  • Waits at least 100ms between consecutive API calls

Warnings

  • This operation is destructive and cannot be undone
  • Always test on a development site first
  • Ensure you have backups of your data before running
  • The tool will request confirmation before deleting data
  • Required reference fields will be made optional (with user confirmation)

Troubleshooting

"Configuration file not found"

Make sure you've created a .wf-cms-purge file in the current working directory with the correct format, or pass -c to point to it.

"No configuration found for site"

Verify that your site slug matches exactly with the section name in your .wf-cms-purge file.

"Webflow API Error"

  • Check that your API key is valid and has the necessary permissions
  • Ensure your API token hasn't expired
  • Verify you have sufficient API rate limit quota

Rate Limit Errors

The tool automatically handles rate limits, but if you consistently hit limits:

  • The tool will wait and retry automatically
  • Check your Webflow plan's API limits
  • Consider running during off-peak hours