🚀 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 website 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: in the Post, when inserting a hyperlink, select link settings or link options, and then check 'Open in New Window'.链接新窗口打开The setting effect for opening links in a new window in the Gutenberg Editor is as shown above.链接新窗口打开The setting effect for opening links in a new window in the Classic Editor is as shown above.

Method 2: Insert a base Tag to Open All Site Links in a New Window

is an HTML language tag. Through the base attribute value, you can set the default opening method for links on the website. The URL opening attributes in tags including , , , and
will be affected by the value of base.链接新窗口打开 Specific implementation method:
  1. WP Admin Dashboard > Appearance > Theme Editor > header.php
  2. Insert code on the next line after

base Tag Attribute Value

Description
_blankOpens the linked document in a new window.
_selfDefault. Opens the linked document in the same frame.
_parentOpens the linked document in the parent frameset.
_topOpens the linked document in the full window.
framenameOpens the linked document in the specified frame.
The above two methods can easily open links in a new window. If you don"t want the entire site to open in new windows, but the links are not within posts, you can directly edit the link tag attributes in the corresponding position of the webpage template and add target="_blank".

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

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about 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 to Follow