How to Open External Links in a New Window or Tab with WordPress

Do you want to open external links from your blog posts in a new browser window or tab?

Opening external links in a new window allows your users to visit the link without leaving your website. This leads to higher user engagement because they spend more time on your site.

In this beginner’s guide, we will show how to easily open external links in a new window or tab on your WordPress site.

Why Open External Links in a New Window or Tab?

External links are links to websites that you don’t own or control. Normally, if you add a link to an external website, your visitors will simply leave your site by clicking on the link.

While some user experience experts say that you shouldn’t open external links in a new window or tab, we don’t agree.

You see, most users easily forget the last website they were visiting. If clicking a link takes them away from your WordPress website to a new site, then they may never return.

For a better user experience, we recommend opening external links in a new window (in older browsers) or a new tab (in modern browsers). This way, the original web page is not lost, and users can resume browsing your website by switching back.

Another benefit of opening external links in a new tab is increased page views and user engagement on your site. Users who spend more time on your site are more likely to sign up for your email newsletter, follow you on social media, leave a comment, and buy your products.

That being said, let’s take a look at how to easily open external links in a new window or tab in WordPress. We’ll cover different methods so that you can choose the one that best suits you.

  1. Opening External Links in a New Tab Using the Block Editor
  2. Opening External Links in a New Tab Using the Classic Editor
  3. Opening External Links in a New Tab Using HTML Code
  4. Opening Navigational Menu Links in a New Tab
  5. Automatically Opening All External Links in New Tab Using a Plugin

The WordPress block editor has a built-in feature that lets you open external links in a new tab. In recent versions of WordPress, this option is visible when adding a link.

Simply edit the blog post or page where you want to add an external link. Next, select the text you want to link and then click on the ‘Link’ button. You can also press the shortcut key CTRL+K on Windows or Command+K on Mac.

Adding a Link in the Block Editor

This will bring up the insert link popup. Simply enter the link and press Enter. After that, you need to toggle the ‘Open in new tab’ option to the On position.

The Open in New Tab Option in the Block Editor

The link will now open in a new tab.

If you are still using the classic editor, then we recommend you start using the new editor. It’s modern, faster, and includes many new features that you are missing out on.

However, if you still want to use the classic editor, then this is how you add a link that opens in a new tab.

First, you need to edit the post or page where you want to add the link. Next, select the text that you want to link (also known as the anchor text) and then click the ‘Insert/edit link’ button.

Add new link in classic editor

A popup will appear where you can add your external link.

After that, click on the gear icon next to it. This will bring up the advanced insert link popup.

Open link in new tab using the classic editor

From here, you need to check the ‘Open link in a new tab’ option. After that, you should click the ‘Update’ button at the bottom to add your link.

Sometimes you may need to write HTML to add a link in WordPress. For example, you will need to do this when using the HTML mode in the new block editor or adding a link in a WordPress theme template file.

You can add the link using HTML code like this:

 <a href=" target="_blank" rel="noopener">Link Text</a>

The target="_blank" parameter in this code tells browsers to open the link in a new window or tab. Simply replace ‘example.com’ with the external link URL and ‘Link Text’ with the anchor text you wish to use.

On your WordPress website, you can add external links in your site’s navigational menu. How you do this depends on whether you are using a traditional theme or a block theme.

Opening Nav Menu Links in a New Tab for Traditional Themes

To open your outbound menu links in a new tab, head over to Appearance » Menu from your WordPress admin area.

Next, click the ‘Screen Options’ button at the top right corner of your screen.

Open screen options

When you click the button, you’ll now see more options.

Go ahead and check the option for ‘Link Target’ under ‘Show advanced menu properties.’

Select Link Target option

After that, you can add a Custom Link to your navigational menu by entering the URL, Link Text, and clicking the ‘Add to Menu’ button.

Your Custom Link will now appear in the Menu Structure column. You can now select the option for ‘Open link in a new tab’ to open your external link in a different tab.

Open external link in a new tab in menu

Once you’re done, click the ‘Save Menu’ button at the bottom.

Opening Nav Menu Links in a New Tab for Block Themes

If you are using a new block theme, then you will need to navigate to Appearance » Themes and use the Full Site Editor to open your outbound menu links in a new tab.

You need to click on the header area at the top of the page, and the header will be selected. Next, click on the navigation area just to the left of the menu. The menu will be selected, and you should see a ‘+’ sign at the end of the menu where you can add a new link.

Select the Navigation Block and Click the + Icon

Tip: Selecting blocks in the Full Screen Editor can be tricky, so many users find it easier to use List View. Simply click the icon at the top of the screen, then find and select the Navigation block. It may be nested inside other blocks, such as Header and Group.

Now you need to click the ‘+’ icon to open a popup where you can add a link. Type the URL in the field at the top, and make sure you toggle ‘Open in new tab’ to the On position. Next, click the ‘Submit’ icon next to the URL to store your settings.

Toggle the 'Open In New Tab' Option On

Once you’ve done that, don’t forget to click the ‘Save’ button at the top of the screen.

It may sound like extra work to manually check the option for every external link that you add. However, over time you will get used to it.

If you run a multi-author blog or often forget to make external links open in a new tab, then you can use a plugin for that.

First, you need to install and activate the Open External Links in a New Window plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

The plugin works out of the box, and it will automatically open external links in a new window.

It does not actually change the external links in your blog posts. Instead, it uses JavaScript to open external links in a new window.

Note: Deactivating the plugin will stop external links from opening in a new window.

As a website owner or blogger using WordPress, you may often include external links in your content to direct your readers to valuable resources, references, or partner websites. When users click on these links, they are usually taken away from your site to the linked external page. However, if you want to keep your website open while allowing users to visit external links, you need to learn how to open those links in a new window or tab. In this article, we’ll explore various methods to achieve this seamlessly.

Understanding target=”_blank”

When you insert a link into your WordPress content, it is crucial to comprehend the target attribute. The attribute target="_blank" is what enables the link to open in a new window or tab. When a user clicks on a link with this attribute, the browser opens the linked page in a separate tab, keeping your original content open and accessible.

Pros and Cons of using target=”_blank”

Using target="_blank" has its advantages and disadvantages. On one hand, it enhances user experience by allowing them to explore external content without leaving your site entirely. This is especially beneficial if you want to ensure that your readers stay engaged with your content while still providing relevant external resources.

On the other hand, some users may find links that open in new tabs or windows annoying or disruptive. It can lead to multiple open tabs cluttering their browsing experience. Moreover, some browsers or browser configurations might block new tabs from opening, which could hinder users from accessing the linked content.

Using plugins to open links in a new window/tab

If you are not comfortable with manually adding the target="_blank" attribute to your links, you can rely on WordPress plugins to handle this task effortlessly. Let’s explore two popular plugins that can help you achieve this:

Subscribe to our list

Don't worry, we don't spam

Plugin 1: “Open in New Window Plugin”

This user-friendly plugin enables you to add target="_blank" to external links automatically. Once installed and activated, the plugin will do the work for you, ensuring that all external links open in new tabs or windows. It saves you time and ensures consistency across your website.

Plugin 2: “External Links – nofollow, noopener & new tab”

Another powerful plugin you can use is “External Links – nofollow, noopener & new tab.” Apart from automatically opening external links in new tabs, it also adds the rel="nofollow" attribute to these links. This attribute informs search engines not to follow the linked page, which can be beneficial for SEO purposes.

Manually adding target=”_blank” to links

Suppose you prefer to have more control over which links open in new windows or tabs. In that case, manually adding the target="_blank" attribute is the way to go. Here’s how you can do it:

Editing existing links

If you have previously added links without the target="_blank" attribute and wish to modify them, you can easily do so in the WordPress editor. Locate the link, click on it, and then click on the “Edit” icon that appears. This will allow you to add the target="_blank" attribute to the link.

Adding code to new links

When adding new links, you can include the target="_blank" attribute directly in the HTML code. Simply switch to the “Text” mode in the WordPress editor, find the anchor tag <a> for your link, and add target="_blank" within the tag.

Best practices for using external links

While incorporating external links in your WordPress content, it is essential to follow best practices to ensure a positive user experience and maintain your website’s integrity.

Ensuring relevance and authority

Only include external links that are relevant to your content and provide additional value to your readers. Make sure the linked page is reputable and offers reliable information.

Adding nofollow attribute when needed

For links that you do not want search engines to follow, such as paid advertisements or sponsored content, add the rel="nofollow" attribute. This will prevent search engines from passing link authority to the linked page.

Testing and optimizing external links

After you’ve incorporated external links into your content, it’s crucial to periodically check and optimize them for the best user experience.

Checking for broken links

Broken links can negatively impact user experience and harm your website’s credibility. Utilize WordPress plugins or online tools to identify and fix broken links regularly.

Analyzing link performance

Keep track of how often users click on your external links and how much time they spend on the linked pages. This data can help you identify the most valuable external resources for your audience.

Conclusion

Opening external links in a new window or tab with WordPress can significantly enhance user experience and keep your visitors engaged with your content. Whether you choose to use plugins for automation or prefer manual control, it’s essential to follow best practices and regularly optimize your external links. By doing so, you’ll provide a seamless browsing experience for your audience while ensuring your website remains a valuable hub of information.


FAQs

  1. Can I open all links in new windows by default? Yes, you can use plugins like “Open in New Window Plugin” to automatically open all external links in new windows or tabs by default.
  2. What if a user’s browser blocks new tabs from opening? While using target="_blank" works in most cases, some browsers or browser configurations might block new tabs from opening. In such cases, users can still access the linked content by clicking on the link and manually opening it in a new tab.
  3. Is it necessary to use the rel="nofollow" attribute for all external links? No, you should use the rel="nofollow" attribute selectively. Reserve it for links that you don’t want search engines to follow, such as paid advertisements or sponsored content.
  4. How often should I check for broken links? It’s recommended to check for broken links regularly, at least once a month. This ensures a smooth user experience and prevents potential SEO issues.
  5. Can I track the performance of external links on my WordPress site? Yes, you can track link performance using various web analytics tools or WordPress plugins that provide link tracking features.
Tech Biz Kingdom - Transforming Business with Technology
Logo
Shopping cart