The reason why many WordPress Developers find it hard to access the option of opening a link in a new window is that it is not easy to see when adding a link in WordPress. This guide is going to show you how to open external links in a new window or tab on your WordPress site and since there are several ways, we are also going to look at some of them so that you can pick one that suits you.
Reasons for Opening External Links in a New Window
An external link refers to a link that you don’t control or own. Usually, your visitors will leave your site by clicking on an external link that you have added to your website. Many user experience experts will tell you that it is not advisable to open external links in a new window. Well, that is just their opinion which we think doesn’t hold any water. It is easy for a visitor to forget the website he or she was visiting, especially one that has opened several tabs trying to find the information they are for.
If you want to give your visitors better user experience, you need to allow them to open external links in a new window or tab. By doing so, you prevent your users from losing the original page they were visiting. They can easily return to that website by switching back. By allowing your visitors to open external links in a new window or tab also helps you to increase page views and user engagement because visitors are more likely to go back to the previous page to finish what they were reading.
You gain a lot when visitors spend a lot of time on your website. It will increase the dwell time which will lead to conversion and subscriptions. Many will follow you on social media, join your email newsletter, or purchase your products. With all these benefits, let’s now explore the several methods used to open external links in a new Window in WordPress.
Opening an External Link in New Window in Gutenberg Editor
The good news is that there is a built-in feature in the new WordPress block editor that allows you to open external links in a new window or tab. The reason why most beginners fail to notice it is because it is hidden behind a button. The first thing you need to do is edit a page or a post where you want to add an external link. When you are done, select the text you want to link and click on the insert link button. After that, select the text. In Mac, press Command + K while in windows you can press CTRL + K. the insert link popup will be displayed on the screen. You will need to enter the link and click on the down arrow next to it. You will be provided with an option to open the link new tab.
Next, you will toggle the option by clicking on it and then press enter. The selected text is now linked and you can visit your website to preview it.
Opening an External Link in a New Window with Classic Editor
Although WordPress introduced a new block editor with WordPress 5.0, the majority of WordPress users still prefer the old editor. Therefore, most of them still use it by installing the classic editor plugin. If you are one of them you are missing on a lot of new features that WordPress 5.0 offers. Plus it’s faster, modern, and stylish. But if you are comfortable with the classic editor, you can still open a link in a new window using this method: the first thing you need to do is edit the post or page where you want to add the link. After that, select the text that you want to link and click on the add link button.
You can add your external link on the popup that will appear. When you are done, you will see the gear button next to it where you will need to click on it. Once you have done that, an advanced insert link popup will be brought up. Check the box next to the ‘Open link in a new tab’ checkbox and add your link by clicking on the ‘Update’ button. Save the changes that you have just made and if you want to see the link I action you can preview it.
Opening a Link in New Tab in Classic Editor with Text Tab
You can also open an external link in a new window if you are using the HTML editor labeled ‘Text‘ in the old classic editor and this is how you do it.
You can start by selecting the text that you want to link and then click on the Add Link button. An advanced Insert link popup will be seen. In this popup, you can add the link and check the box next to the ‘Open link in new tab’ option and click on the Add Link button. The popup will disappear and in the text editor, you will see the HTML code for the link. Save the changes made and if you wish to see the link in action, you can preview it.
Opening External Links in a New Window with HTML
There are instances where adding a link in WordPress requires you to write HTML. This may be necessary you adding a link in a WordPress theme template file or using the HTML mode in the new block editor. Use the following HTML code to add the link.
<a href="http://example.com" target="_blank" rel="noopener">Link Text</a>
In example.com, put the external link URL, and in the Link Text, put the text you want to link.
These are the few ways you can use to open external links in a new window or tab in WordPress Development. The processes are quite simple and anyone running a WordPress blog can handle it including beginners. We trust that this article was helpful to you and you can now improve your website’s user experience by allowing them to open external links in a new window in WordPress.
Naman Modi is a Professional Blogger, SEO Expert & Guest blogger at ebuilderz.com, He is an Award-Winning Freelancer & Web Entrepreneur helping new entrepreneur’s launches their first successful online business.