How to Open External Links in a New Tab in Webflow
Learn how to automatically open all external links in a new tab in Webflow with JavaScript.
In this tutorial, Sandro, cofounder of Gemeos Webflow agency, shows you how to automatically open all external links in a new tab on your Webflow site.
Example
The script
This script automatically detects all links that point to a different domain than yours and adds target="_blank" and rel="noopener noreferrer" to them.
Desktop only version
On mobile, opening in a new tab is less useful (multi-tab browsing feels less natural). To apply the script only on desktop:
Conclusion
This script is added once globally and automatically applies to all links on the site.
Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
.avif)














