https://github.com/log1x/allow-unsafe-links
Prevents WordPress from automatically adding noopener and noreferrer to outbound links.
https://github.com/log1x/allow-unsafe-links
affiliate-tracking wordpress wordpress-plugin
Last synced: about 1 month ago
JSON representation
Prevents WordPress from automatically adding noopener and noreferrer to outbound links.
- Host: GitHub
- URL: https://github.com/log1x/allow-unsafe-links
- Owner: Log1x
- License: mit
- Created: 2019-05-24T11:03:40.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-24T11:17:30.000Z (about 7 years ago)
- Last Synced: 2025-02-09T08:17:08.809Z (over 1 year ago)
- Topics: affiliate-tracking, wordpress, wordpress-plugin
- Language: PHP
- Homepage: https://github.com/Log1x/allow-unsafe-links
- Size: 3.91 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Allow Unsafe Links
[](https://packagist.org/packages/log1x/allow-unsafe-links)
[](https://packagist.org/packages/log1x/allow-unsafe-links)
Starting in WordPress 4.7.4 and 5.1, WordPress now automatically adds `rel="noopener noreferrer` to external links that open in a new window (e.g. `_blank`) when adding a link from TinyMCE (4.7.4) as well as on post save (5.1). With the introduction of it passing your content through a filter on post save, it is no longer possible to publish a post without the tags even when manually removing them.
While I 100% endorse this behavior deeming the potential [security concerns](https://developers.google.com/web/tools/lighthouse/audits/noopener) when not including these tags (especially `noopener`), this can lead to unwanted behavior on URL's such as affiliate and referral links due to a variety of networks poor implementation of tracking.
If you are not using an advertiser network that has the potential issues stated above, **you should not be using this**. Otherwise, please use this with caution and for the safety of you and your users, please add `rel="noopener noreferrer"` on outbound links manually that are not affiliate-related.
## Installation
### Composer
```sh
$ composer require log1x/allow-unsafe-links
```
### Manually
[Download](https://github.com/log1x/allow-unsafe-links/archive/v1.0.1.zip) and install the plugin as you would any other WordPress plugin.
## Usage
Once activated, you're good to go. For existing posts, you will need to go through and manually remove the `rel="noopener noreferrer"` on your URL's and re-save.
This can also be done via [`wp-cli`](https://wp-cli.org/) using `search-replace` such as:
```sh
$ wp search-replace ' rel="noopener noreferrer" ' ''
```
## License
Allow Unsafe Links is provided under the [MIT License](https://github.com/Log1x/allow-unsafe-links/blob/master/LICENSE.md).