Home CMS Tutorial WordPress How to redirect external links in wordpress

How to redirect external links in wordpress

Jul 13, 2019 pm 02:19 PM

How to redirect external links in wordpress

When we write articles, we may inevitably encounter times when we need to jump to external links, but jumping directly to external links may be demoted by search engines. What should we do? ? So here are two very simple external link jump methods to solve this problem.

1. Open Editplus and create a new PHP file, copy and paste the following code, then save it as go.php and upload it to the root directory of the website

Then the jump format is: {this site address} /go.php?url={External link address}, for example:

https://www.php.cn/go.php?url=https://www.baidu.com/

2. Open Editplus and create a new PHP file, copy and paste the following code, then save it as go.php and upload it to the root directory of the website.
The resulting form is {this site address}/go.php?{external link address}. Compared with the first one, the url= is removed and is slightly shorter.

Note: Finally, don’t forget to add: Disallow: /go.php? to the robots.txt file to prevent search engines from crawling go.php, otherwise it will have no effect.

For more wordpress related technical articles, please visit the wordpress tutorial column to learn!

The above is the detailed content of How to redirect external links in wordpress. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The 5 Best IDEs for WordPress Development (And Why) The 5 Best IDEs for WordPress Development (And Why) Mar 03, 2025 am 10:53 AM

The 5 Best IDEs for WordPress Development (And Why)

Create WordPress Plugins With OOP Techniques Create WordPress Plugins With OOP Techniques Mar 06, 2025 am 10:30 AM

Create WordPress Plugins With OOP Techniques

How to Pass PHP Data and Strings to JavaScript in WordPress How to Pass PHP Data and Strings to JavaScript in WordPress Mar 07, 2025 am 09:28 AM

How to Pass PHP Data and Strings to JavaScript in WordPress

How to Embed and Protect PDF Files With a WordPress Plugin How to Embed and Protect PDF Files With a WordPress Plugin Mar 09, 2025 am 11:08 AM

How to Embed and Protect PDF Files With a WordPress Plugin

See all articles