Code

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.

Bulk Delete 301 Redirects from Webflow Settings preview

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

  1. Go to your projects Webflow hosting settings page, this page is in Project Settings and NOT in deisgner
  2. Open your browsers console and paste the code found within the JS section
  3. 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);
});

                    

Browse similar code snippets

Categories

Language

More from Corey Moen

Profile →

Related Webflow questions

All answers →