Do you know how to choose between opening a website link in a new window or the current window? You may have noticed while browsing the internet that some websites open linked content in a new browser window (e.g., Baidu search results), while others open content directly in the current window (e.g., Google search results). In this article, Naiba will introduce when to choose to open links in a new window and when to open them in the current window.
What is a new window?

For example, Baidu"s search results open in a new browser window when clicked. In HTML, the code is target="_blank".
<a href="#" target="_blank">Link</a>
We can set this when inserting links in WordPress.

When should you choose to open in a new window?
First, we need to understand the purpose of opening in a new window. For example, why does Baidu open in a new window, while Google defaults to opening search results in the current page? You may have noticed that if opened in the current window, it's like you've exited Google and entered the search result page. Baidu opens in a new window, so you see the results but still retain a Baidu page. Therefore, when building our own website and inserting links, we usually open links to our own site in the current window, while links to third-party websites open in a new window. However, we must analyze based on actual situations, such as
Steps to Build Your Own WebsiteMost links in the article open in new tabs. Normally, after reading step one, users will view step two. If opened in the current window, users would need to go back or reopen the page, which is troublesome.
Set all links to open in a new window
If you find it too troublesome to set each link to open in a new window one by one, you can directly add the following code to the webpage header to make all links open in a new window.
<base target="_blank" />
Summary:
In summary, the general rules for opening links in a new window versus the current window are:
- When accessing external websites, open in a new window;
- When accessing pages on your own website, open in the current window;
- When accessing related reading pages on your own website, open in a new window.
Opening external webpages in a new window allows users to stay on your website, increasing page views (PV). However, if all links on your own website open in new windows, users may open several tabs within minutes of visiting your site, which can cause annoyance and negatively impact user experience.
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.