This script helps you delete all items in given webflow collections. Basically "wipes" given collections. It also has the option to WIPE ALL collections in a Webflow site.
When dealing with Webflow projects that involve complex CMS architectures, Deleting all items in a Webflow collection requires huge manual effort. You got to delete items in batch of 50 for each collection. This task becomes a nightmare if you are dealing with thousands of items with CMS structures involving heavy reference/multi-reference fields.
These situations arise especially when you work in niche products that involve boilerplate setup where you would want to start a fresh CMS scene for different clients.
Always back up your Webflow site before running this tool. This script DELETE all items in your CMS Collections that cannot be automatically undone. A backup ensures you can restore your content if something goes wrong.
Make sure you have Node.js installed before proceeding.
- Clone this repository,
- Open the repository folder in a code editor like VS Code.
- Open up a fresh terminal instance, then run:
npm install
Or if you prefer to use yarn, you can run:
yarn install- Run:
npm start
Or
yarn start
- Go to your Webflow Dashboard.
- Click the three dots on the desired Webflow site.
- Click "Settings".
- Click "Apps & Integrations".
- Click "Generate API Token". (Important: make sure to pick the v2 API token, the blue button).
- Under the "Generate API Token" dialog, give a name and grant "read and write" permissions for CMS. Additionally, If you are looking to WIPE ALL collections, also grant "read-only" permission for Sites.
- Click "Generate Token"
- Copy the API token and store it somewhere safe for later.
(Skip this step if you are using the Wipe All Collections option)
- In your webflow designer, Open your CMS Panel
- Open the Collection settings of the collection and copy the collection id.
- Copy the collection ids of all the collections you want to de-reference and store it somewhere for later.
Input the API Key where it says:
Enter your Webflow API token:
Then, Enter collection IDs, or leave blank to wipe all collections in the site:
Enter your Webflow collection IDs (comma separated, or leave blank to wipe all collections):
Note: When choosing the WIPE ALL option, you have to explicitly confirm the action with a 'y' or 'yes'.
If you entered specific collection IDs, you will also be asked for locale numbers:
Enter locale numbers to wipe (comma separated or leave blank to wipe primary locale only):
Note: All available locales along with numbers will be listed above. Leaving this blank will only wipe the primary locale. If you chose the WIPE ALL option all locales (primary and secondary) will be wiped automatically.
Sit back and relax while the script processes each collection and wipes them clean.
After wiping is complete, publish your site in the designer for changes to take effect in LIVE site.
Twitter - https://x.com/harikshore15 Email - harikshoresridharan@gmail.com