Bulk upload 301 redirect for slugs

As I convert more sites over from WordPress, it would be very handy to have a bulk 301 redirect system. I’m finding myself doing this manually far too often.

WordPress blogs are usually /blog-post-slug and the Webflow is always /post/blog-post-slug

Is there an easy way to redirect all those?
Am I missing something here?


Here is my public share link: LINK
(how to access public share link)

Hi there,

Thanks for reaching out about the bulk redirects. At the moment there is not an option to bulk import the redirects, see here on the Wishlist: Bulk addition of redirects | Webflow Wishlist

Their is a good chance this will be added in the near future, but in the meantime, I usually use google sheets and keyboard maestro (or similar program for Windows) to add the redirects by automating those keystrokes and actions necessary to enter the redirects from the google sheet.

1 Like

Sorry to hijack this threat but…

@cyberdave - Do you mind explaining more about your redirect process using keyboard maestro?

I’m in the same situation with nearly 24,000 redirects I need to include - I have the Google Sheet with the Old to New URLs listed out, I just need to get them into Webflow!

1 Like

Hi @cyberdave , this would be super helpful, could you please share how to do this?

Do you know if it would be possible with the free trial?

Thank you

I have created a video tutorial showing how you can add over 1000 links in a few seconds! Hopefully it helps you, this was a nightmare for me!

1 Like

Amazing, thank you for sharing this @Max_Shepley .

Those nightmare situations can lead to so much learning though.

For sure! They’re the best way to get better I reckon!

I hope the video is useful :slight_smile:

Is there a way to bulk export the existing 301 Redirects?

I need to migrate to a new project and want to bring all the old redirects with me — looking for the simplest way to do it!

Yeah, a bit of a hack on Janne’s import script here and Laura’s script update here, and you can make an export script.

Here’s how to use it;

  1. Login to webflow, go to site settings, to the publishing tab where you see the redirects list
  2. Open Chrome dev tools CTRL+SHIFT+I
  3. Go to the console
  4. Paste this script and press enter
var hostingContainer = document.getElementsByClassName('redirects')[0];
var hostingController = angular.element(hostingContainer);
var scope = hostingController.scope();

var csv = `"Source","Dest"\r\n`;

scope.redirects.forEach(function (rule) {
	csv += `"${rule.src}","${rule.target}"\r\n`;
});

console.log(csv);

var hiddenElement = document.createElement('a'); 
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
hiddenElement.target = '_blank';
hiddenElement.download = 'redirects.csv';
hiddenElement.click();

That last bit should automatically create and download a CSV file, you can save it where you like. If it doesn’t work, you’ll see the CSV in the console as well and can copy paste.

I haven’t tested this on a large set of redirects, hopefully it will get all of them.

Anyone who uses this, please let me know if it worked for you, and how many redirects you exported. I’m very curious to know how smoothly it works on a large list, if at all.

1 Like

Hi there. If anybody is having trouble with the script for this, Laura North posted an updated version of the script at How to Bulk Import 301 Redirects to Webflow

var hostingContainer = document.getElementsByClassName('redirects')[0];
var hostingController = angular.element(hostingContainer);
var scope = hostingController.scope();

var redirects = [

{redirectPath: '/old-path', redirectTarget: 'new-path'},
];

redirects.forEach(function (rule) {
scope.redirectPath = rule.redirectPath;
scope.redirectTarget = rule.redirectTarget;
scope.addRedirect();
});

Make sure your old paths have “/” at the start.

Hope this helps!

1 Like

Latest on this is Max_Shepley’s video tutorial is amazing, but the link to his website is 404 error. Not a good sign for a video about 301 redirects.

And then Finsweet have Chrome plugin that does many things, including enabling bulk 301 uploads

Unfortunately the export script from @memetican and others no longer works - it looks like the WF team have changed their front-end framework.

Here’s an updated version. It’s not terribly robust as it assumes WF won’t change things again, but it works for now!

To run, you first need to select the text “301 redirects” on the site settings page (the new framework uses unintelligible class names so it’s hard to identify the table of redirects).

1 Like

Thanks Sam, haven’t used this in awhile- I’ve added your links to the blog post.

1 Like

As of July 2023, the following script works:

var tableRows = document.getElementsByTagName('tr');

var csv = `"Source","Dest"\r\n`;

for (let i = 0; i < tableRows.length; i++) {
    let spans = tableRows[i].getElementsByTagName('span');
    if (spans.length >= 2) { // Check if we have at least two spans (source and destination)
        let source = spans[0].innerText;
        let destination = spans[1].innerText;
        csv += `"${source}","${destination}"\r\n`;
    }
}

console.log(csv);

var hiddenElement = document.createElement('a'); 
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
hiddenElement.target = '_blank';
hiddenElement.download = 'redirects.csv';
hiddenElement.click();

Can this be made to remove bulk redirects? There were some old scripts, but now they don’t work. How in world should I remove manually 1000 records?