Do you want to hide all external resources on your blog from search engines? A good option would be to close WordPress links from indexing. Let’s figure out how to do it right.
Does it need to be closed?
YES! A large number of links to external resources are regarded by search engines as link spamming. For example, you write product review articles and insert affiliate (or Affiliate) links. If there are a lot of them, then you risk falling under the filter. And this is a decrease in the visibility of the site in the search or even exclusion from it. In addition, such a page may lose link juice.
How to remove external links
There are 2 working methods:
- Add attributes to each link.
- “Hide” via JS script.
Let’s take a look at both methods.
Using Attributes
A normal link looks like this:
<a href="https://site.com">Текст ссылки</a>
With attributes:
<a href="https://site.com" rel="nofollow external noopener noreferrer sponsored">Текст ссылки</a>
They can be put down in 2 ways: in the editor or through the plugin.
Plugin
This is easy to do with the External Links WP plugin. Extension for the whole site: content, header, footer, widgets.
- Install and activate.
- In the admin panel go to External Links.
- On the tab with the same name, check the one you need.
- Save your settings.
WordPress editor
Suitable if you do not want to clog your resource with unnecessary modules.
Also see: How to create the perfect robots.txt for WordPress
- Open the post for editing and add a link.
- Switch to Edit as HTML mode.
- Insert attributes.
- Switch to normal mode (Edit visually).
js script
The WP No External Links plugin is perfect for this.
- Install and activate.
- Open Settings > No External Links, go to Link Encryption.
- Enable Encode links with base64.
The URL-Link will be encrypted and an attribute will be added to open the link in a new web browser tab:
<a target="_blank" rel="nofollow" href="https://site.com/goto/aHR0cHM6Ly9wZXRyb3YucHAudWE=">
If you want to choose where on the site to mask links, then for this there is a section What to mask.
Hiding links in comments
If you need to close links in discussions from indexing, then there is a great option – the Clearfy Pro premium plugin.
- Go to the Clearfy Pro section.
- On the SEO tab, check all options.