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

2 Simple Methods to Open WordPress Website Post Links in a New Window

How to set WordPress post links to open in a new window? This article introducestwo very simple methods to achieve opening links in a new window

Method 1: Check 'Open in new window' when adding a link

The specific method is as follows: when inserting a hyperlink in a post, select the link settings or link options, then check 'Open in new window'.链接新窗口打开The Gutenberg editor link new window opening setting effect is as shown above.链接新窗口打开The classic editor link new window opening setting effect is as shown above.

Method 2: Insert a base tag to make all site links open in a new window

<base> is an HTML language tag. Through its attribute values, you can set the default opening method for links on a website. The URL opening attributes in tags including <a>, <img>, <link>, and <form> will be affected by the base value.链接新窗口打开 Specific implementation method:
  1. WP Admin > Appearance > Theme Editor > header.php
  2. Insert code on the next line after <head>
<base target="_blank" />

base tag attribute value

Description
_blankOpens the linked document in a new window.
_selfDefault. Opens the linked document in the same frame.
_parentOpen the linked document in the parent frameset.
_topOpen the linked document in the entire window.
framenameOpen the linked document in the specified frame.
The above two methods can easily achieve opening links in a new window. If you do not want the entire site to open in a new window, but the links are not within articles, you can directly edit the link tag attributes at the corresponding position in the webpage template and add target="_blank".

🚀 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: