The script below allows the CSV export of all CMS collections of the currently opened Webflow project. Just run the code below from the console while on the Webflow Designer view.
I’m leaving this more for myself for future reference, but it might be a useful snippet for anyone:
const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
const collectionMenuEntries = document.querySelectorAll(`[data-automation-id="cms-collections-list"] > div`)
for await (const menuEntryEl of collectionMenuEntries){
menuEntryEl.click();
await sleep(3000);
const exportButton = document.querySelector(`[data-automation-id="cms-collection-export-button"]`)
exportButton.click();
}
Two things to keep in mind:
- I’m not sure if Webflow also uses ‘Virtualized lists’ for the list of CMS collections. In case the
collectionMenuEntries
variable doesn’t hold references to all the CMS collections links, just zoom out your browser as much as you can to the point of you being able to see all the collection lists on your viewport. - I don’t love the hardcoded value of
3000
ms value for thesleep
in that code. It was a quick and dirty solution and it worked, but given its ‘hardcoded’ aspect, it might not work at all times. Keep that in mind.