How to Make Links Open in a New Window or Tab With Simple JS Code

Updated on
How to Make Links Open in a New Window or Tab With Simple JS Code

According to usability studies, opening a new link in the same browser is a good practice. But in many instances, the webmasters prefer to open a link in another tab, like for external links. If the external link opens up in the same tab, the user will leave your website. If they want to return back, they will need to hit the Back button. To avoid the users leaving your website and going to any external link, we are providing you a simple JS code. Follow the instructions below that will not let your website disappear from the users’ eyes.

Go to Storefront Design > Design Options > Scripts. Here you will add the code shown below:


Updated on

Leave a comment

Please note, comments need to be approved before they are published.

Featured Service: Ecommerce Migration

Switching ecommerce platforms can feel overwhelming, but with Web Ecommerce Pros, it doesn’t have to be. Our Ecommerce Migration service ensures a seamless transition, moving your store’s products, customer data, and SEO rankings without downtime or lost functionality. Whether you're upgrading for better scalability, improved performance, or enhanced features, we handle the entire process—so you can focus on growing your business. From data transfer to design adjustments, we make sure your new platform is fully optimized and ready to sell. Let us take the hassle out of migration and get your store running smoothly on the right platform!