🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

How to Determine Whether to Open a Webpage in a New Window When Writing Website Posts

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 asSteps 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:
  1. When accessing external websites, open in a new window;
  2. When accessing pages on your own website, open in the current window;
  3. 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.

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the Website Building Coaching Service
🔒

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.

×
二维码

Scan QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: