What link obfuscation consists of and how to implement it.

Link obfuscation consists of creating a “link-like” effect that search engines will not understand as such. In short, it involves creating a link that is only readable by the user and not by search engines.
To explain how to apply this technique and when it is advisable to use it, it is necessary to understand how links are used and what they consist of.
A link is something that relates two or more elements. In computing, a link can be unidirectional. It is the classic text/button that is usually highlighted and, when clicked, takes you to another page, multimedia element, or email.
In HTML it is usually presented like this:<a href="URL" title="link title" rel="Implies the relationship between the current document and the linked one" target="Specifies where to open the linked document">Link text, in SEO known as Anchor Text</a>
It is important to understand how a link is usually presented in HTML in order to understand how to perform obfuscation.
Google Developers also explains in its documentation how to create a crawlable link. This will give us a very important clue that will be useful later.

As I explained above (in the code), the rel attribute implies the relationship between the current document (for example, our website) and the linked one (for example, a website we link to), with specific effects.
For a link to be “dofollow”, the correct implementation is to not include any indication (they are indications, not directives) that prevents crawling
Which rel attributes does Google understand to block crawling?
It is a generic indication to state that you do not want Google to associate the content of the linked page nor crawl it by following the link.<a href="URL" rel="nofollow">This would be a nofollow link</a>
It has the same effect as the nofollow attribute; however, it is the recommended one for paid links.<a href="URL" rel="sponsored">This would be a paid link</a>
Like Sponsored, it has the same effect as nofollow, but this time it is intended for links created by users of your website.<a href="URL" rel="ugc">This would be a link generated by a user</a>
Noopener: It is an attribute that prevents the page being opened from accessing “window.opener” via JS, making the link more secure.<a href="URL" rel="noopener">This would be a “more secure” link.</a>
Noreferrer: It is an attribute that performs the same action as rel=”noopener” but also hides the information indicating that the user who clicked the link comes from your page.<a href="URL" rel="noreferrer">This would be a link with the properties of noopener but also hiding where it comes from.</a>
All these attributes can be combined, although it is not necessary.
Link Juice is a colloquial but widely used term that identifies the “strength” transmitted on a site through links.
The example of glasses is very common and widespread to understand how it works. It is an approximate and illustrative idea that will help us understand what is necessary, since this is not a post about Link Juice.

As can be seen in the example, when nofollow is used, the strength continues to be distributed equally. Therefore, it does not work to do PageRank Sculpting as it did before.
PageRank Sculpting consists of placing links without losing or distributing the strength of the website.
On the other hand, whether one agrees or not, what is officially stated by Google is that the concept of Link Juice is obsolete. This does not mean that a link to an external website has no effect.
When we have a page and links are added, Link Juice is distributed among them. Since it is no longer possible to do PageRank Sculpting with the nofollow attribute, I have experimented through logs and found that nofollow links are crawled by Google. You can also find many experiments by other SEOs showing that a nofollow link (and similar attributes) is simply an indication, which Google may or may not take into account.
It is not known exactly whether Google really takes into account the connection between both elements. But there is a theory that Google considers the indication, but ultimately does what it deems most appropriate.
So, obfuscating a link would be a way to ensure that this does not happen in any case. For example, if we have a B2B company that operates in the betting sector and we need to link to a partner or client through whom betting is allowed via their website, but we do not want Google to associate our website with betting, since that is not the goal of the website.
In Google’s documentation, we can see that Google is very clear regarding link hiding and its penalization, and it considers it as Black Hat SEO.
However, despite all the warnings it gives in this regard, it refers to links that are not easily visible to the user, but can be easily accessed by a search engine. In reality, Cloaking consists of exactly the opposite. In fact, that same documentation specifies that it does not consider the use of technologies such as JavaScript to be deceptive, even if they are not easily read by search engines, but do improve user accessibility. That is where the trick lies.
Cloaking really consists of showing different content to the user than to search engines (for example, modifying what is visible depending on the User-agent). However, by using obfuscation, we show the same thing to the user as to search engines. The difference is that, as I explained in the first image, Google does not consider this functionality to be a link. And in theoretical terms, it is not, although in practice, for the user it results in the same effect as a link.
Once we have understood what links consist of and what obfuscation could be useful for, let’s see what ways we have to obfuscate using JavaScript. You have copy-ready examples below.
This is the method that Google itself indicates in its documentation that it is not able to read. It is done inline and does not require programming knowledge, just knowing how to insert the code into HTML.
Inside the HTML element (I recommend a span or a div) it should be written as follows:<span onclick="location.href='URL'">anchor text</span>
Javier Morell states that he has detected that Google has been able to access and crawl a page that was only linked using this method. So we can leave this form of obfuscation in quarantine
According to the Google documentation, in fact, what he mentions is true, so this is no longer an effective method of obfuscation.
This is a slightly more complex form of obfuscation but harder to detect. It requires knowing how to call an element via its ID or class in JS. It also allows you to store that code in cache, which slightly improves WPO. In addition, it allows for better control of hidden links.
There are many articles such as this one, where it is explained how you can add an extra twist and encrypt it to make it harder to detect. In reality, so much encryption is not necessary and can greatly complicate the maintenance of the website itself. I do not especially recommend it, but it is another option when it comes to obfuscation.
If we want the website we link to know that the “link” comes from our website, we can always add a UTM parameter.
Once we have seen the theory, let’s see how it is done. Here you have code examples if you click on the image:
For more information you can watch this video about link obfuscation that I recommend.
Another way to prevent Google from reading your links is through robots.txt, but in this way you also prevent Google from reading the content of your page, so it is not a recommended practice.
The a tag should not be used: According to Google’s own documentation, even if it is done with JavaScript, if it is an a tag, Google may try to crawl it. More information.
I currently offer advanced SEO training in Spanish. Would you like me to create an English version? Let me know!
Tell me you're interestedIf you liked this post, you can always show your appreciation by liking this LinkedIn post about this same article.