Home  >  Article  >  CMS Tutorial  >  How to redirect external links in wordpress

How to redirect external links in wordpress

尚
Original
2019-07-13 14:19:574587browse

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