Bulk Delete 301 Redirects from Webflow Settings
A simple way of bulk deleting 301 redirects from within Webflow's Hosting settings. This makes updating, cleaning up, removing 301's redirect a breeze rather than a labor intensive process.
A simple way of bulk deleting 301 redirects from within Webflow's Hosting settings. This makes updating, cleaning up, removing 301's redirect a breeze rather than a labor intensive process.
How to add it
- Go to your projects Webflow hosting settings page, this page is in Project Settings and NOT in deisgner
- Open your browsers console and paste the code found within the JS section
- Adjust the code based on your requirements
The code
Javascript
var hostingContainer = document.getElementsByClassName('hosting-tab')[0];
var hostingController = angular.element(hostingContainer);
var scope = hostingController.scope();
var interval = 500;
var redirects = [
{source: '/old1'},
{source: '/old2'},
];
redirects.forEach(function (rule, index) {
setTimeout(function () {
scope.removeRedirect(rule.source);
}, index * interval);
});