This is a major SEO concern, as slugs are indexed by Google for public-facing apps. Right now, when a thing’s slug changes, any links to that URL result in a 404, and Bubble doesn’t make it easy at all to set up 301s via a workflow. Honestly, it would be SO nice if 301 redirects were set automatically whenever a thing’s slug changes.
At the least, though, it would be super useful to have a workflow action for “set 301 redirect” that we could use after “change a thing’s slug” actions. And if there’s already a way to do this, please let me know!
2 Likes
Hi Sam,
I have just spent quite some time looking for exactly what you have asked for here. Unfortunately, I didn’t find it but did manage to come up with my own workaround.
What I have done is add a list field called ‘previous slugs’ to the datatypes I have where the slugs can change, eg: blog posts. Whenever the slug is changed (in my case due to the blog title changing) I add the original slug to the previous slugs list and then update to the new slug.
Then, on the page where the data type is displayed (for me the blog page), I have a ‘do when page loaded’ condition that only triggers if the page’s content type is empty (this is what happens when a Google indexed page has its slug changed). That has a single workflow step that is ‘go to page’ and then the page it points to is the blog page and the data to send is:
‘do a search for blog posts where previous slugs contains (get path segments from page URL item #2) first item’
This will then redirect to the new content. It’s not perfect but the best I could come up with until Bubble enables a add 301 redirect workflow item.
Hope this helps!