Do you want to come to Andalu-SEO?
Andalu-SEO

Referrer Attribute for SEO

Creative uses of the referer/referrer for SEO

Referrer Attribute for SEO
Author:
Carlos Sánchez
Topics:
Crawling
,
LinkBuilding
,
servers
Publication Date:
2026-01-29

Last Review:
2026-01-30

In all the old-school SEO guides, they talk about the rel= attribute for <a> tags, that is, for links.

The rel attribute has several values:

If you want to dive deeper, I wrote a complete guide on link obfuscation and how to prevent Google from following links where I cover this topic in more detail. And as a short answer to what you're probably wondering, yes, Google interprets nofollow, ugc, and sponsored the same way.

However, I want to emphasize the Referrer for today's article, as it can have more uses for SEO nowadays than many professionals might expect.

The rel="noreferrer" attribute, as its name suggests, prevents the browser from sending the HTTP Referer header to the link destination. I wanted to start the introduction here because, for most SEOs, this is usually the first point of contact with the referrer concept and yet it's a commonly undervalued attribute that can offer us much more utility than one might initially expect.

Fun fact: While it's true that many modern browsers have noopener by default when it's target="_blank", it's also automatically added if you use noreferrer.

What is the referer?

The referrer (or Referer) is an HTTP header that the browser sends to the destination server indicating the URL from which the request originated. It's commonly used to identify the traffic source, measure references between pages, and apply analytics, security, or access control logic.

Curious anecdote: You may have noticed that I've written referrer but also talked about referer. The reality is that it's officially spelled with double r. However, in the original HTTP standard, there was a typo and the header remained as Referer.

ContextCorrect spelling
HTML Attributerel="noreferrer"
HTTP HeaderReferer
Security PolicyReferrer-Policy

Analyzing the referrer

For me, it's much easier to see and understand with visual examples, so I'm going to show it through images. I'll show you 2 examples, one with referrer and one with noreferrer so you can see the difference.

If we go to ahrefs and examine a project, when we're in the overview, the link to the project we're examining appears at the top. In this case, in the tool we have an <a> tag that doesn't add any noreferrer.

screenshot of the ahrefs page, where you can see carlos.sanchezdonate.com/ highlighted and above it indicates that it's an a tag

If we click the link, the website will open in another tab (for the referrer, it's irrelevant whether it opens in the same tab or another).

If we open Chrome's console in that new tab.

Keyboard showing how to open Chrome console

Once opened (refresh with F5 without disabling the cache if nothing appears), we follow this process:

  1. Click on Network.
  2. Select the HTML file, which will be the first one that appears.
  3. Stay on the Headers tab, which is the first one that appears.
  4. Open the Request Headers subsection (don't confuse it with Response Headers).
  5. Look for where it says referrer and there you'll see where our request came from.

Steps to follow in Chrome console

And this is what many well-known measurement tools use to know the origin of clicks, although you should be careful with bots to avoid false positives.

If we use that same method to check the click from the ahrefs dashboard, meaning from here to our project directly, we won't be able to see it since there's a noreferrer.

The image shows a link with noopener noreferrer

Improving SEO with referrer

As expected, all this explanation wasn't simply to entertain you, but to give you real, often undervalued, and often unconsidered uses that can be a good solution.

Analytics

It's clear that the most well-known use of the Referrer is analytics, and we'll start with it since it's the simplest and its main use, but we're going to give it a twist, since tools like GA4 or Ahrefs Web Analytics already incorporate this referrer.

With programming knowledge, a team of developers, or even with time and your code LLM and motivation, you can analyze and save information about certain very simple key aspects.

Link Building Analysis

Have you obtained a link and want to know if it's worth it in terms of traffic? The possible impact on SEO is usually evaluated and nowadays on artificial intelligences, but the quality of a link can also be measured by whether it brings you traffic directly.

Example Prompt for WordPress:

Create a plugin for WordPress that saves in the DB every time a user accesses my website with a referrer from {whatever}.com or any of its subdomains. I want the date and time to be recorded in the DB. Create a table in the database with the code itself (and put a condition that if that table exists, don't create it again). Allow me to see the visit data in the WordPress backend with that code. Then briefly explain how to save the file, compress it to zip, and upload it in my WordPress panel.

And we'd have a basic, simple plugin with no impact on website speed that would work like this (I've used the example with links from ahrefs to a test page):

You can see the Ahrefs Referrer Logs plugin with the visit log where the referrer is ahrefs.com or subdomains

(you can complement it more if you want to add IP and user-agent blacklists and options to export and clean the tables, but this is to show you the concept).

Log Analysis

You can also see records of everything that has entered your website by referrer previously if you have Logs enabled on your website, and then you can extract the information in various ways to analyze the traffic origin of your website with logs.

The good point is that you'll have all the information, the bad point is that having all the information means you then have to filter a lot to extract the data.

LLM Referrer

Most well-known LLMs allow you to analyze them through referrer. Additionally, in this case, the data is less muddied because since these are links generated for users, bots are less likely to generate them and click.

In some LLMs like ChatGPT it works, but there are exceptions like visits from iPhone on mobile (there are other ways to analyze it), but except for Deepseek, Openevidence, and a few others, all of them allow the referrer.

However, having the referrer as a base, you can play around quite a bit when it comes to showing visits that come through users via their LLM and analyze day, time, most visited pages, whether these pages return a correct response code, or any metric necessary for LLMs.

Plugin example
Example of a commercial Plugin that can be generated with Referrer as a base

All this without the need for JavaScript or Cookie consent, being able to check thanks to the referrer and a bit of code, combined with other tools like brand radar if your strategies with LLMs are working.

User Experience

And yes, with something as simple as the referrer you can improve a website's UX, with cases that people don't usually think of.

Migrations

Imagine you're working on a project where one company has bought another or they've merged.

They work in the same sector, but they want to unify it under one brand.

Let's say there's website A and website B, and everything is going to be unified on website A.

In principle, if brand B has ceased to exist, it makes sense to redirect everything to website A, unify efforts, and grow brand A.

But it's quite possible that there were regular customers of website B.

The feelings that a customer of website B can have when redirected to a different brand can include:

In many possible scenarios, the user may end up doing another search on Google, a query in LLMs, or any situation where, given the disappearance of the website where they used to make their purchases/transactions, they end up landing on competitor pages when looking for alternatives.

With the referrer, we could make a very simple adjustment, since the referrer also travels through redirects.

We could make it so that if the user comes from website B, a Pop-Up appears on website A explaining the acquisition and telling them if they'll have the same services, prices, and giving them a personalized welcome explaining everything in a friendly way and greatly improving the experience.

By giving this warm welcome, we can significantly reduce the percentage of users who look for information about what happened outside the website, and we also don't have to "bother" with unnecessary information those who were already veterans of website A.

Dynamic Content

With the referrer, you can manage more dynamism between websites, whether through obtaining a link from a website with synergy or a target audience to whom you can offer a discount.

For example, on the Andalu-SEO website something special happens if you access from ahrefs.

Shows what happens on the andalu-seo.es website if you access from ahrefs

This same example can be used for any idea you can think of for a website that mentions yours.

Preventing Hotlinking

One of the most classic—yet also most undervalued—uses of the referrer is hotlinking prevention, that is, preventing third parties from directly loading resources from your website (mainly images, videos, or PDFs) from their own pages.

Hotlinking has two clear impacts:

This is where the referrer becomes an extremely useful and clean tool, as it allows you to know from which domain a resource is being requested, without the need for JavaScript, cookies, or user consent.

How does it work at a conceptual level?

When a browser loads an image (<img>), a video (<video>), or any other resource, it sends the HTTP Referer header indicating from which page the request is being made.

With this information, you can apply conditional logic at the server level.

Ways to use the Referrer to prevent Hotlinking

Some of the most common and effective strategies are:

1. Directly block the resource loading

If the referrer doesn't belong to your domain or a whitelist, you can return:

This prevents the resource from being displayed outside your website.

2. Replace the resource with another

Instead of blocking, you can:

This option is interesting when you want to maintain brand visibility even in cases of misuse.

3. Allow only certain referrers (whitelist)

You can explicitly allow:

This is especially useful when you collaborate with other media or when you need certain resources to be legitimately embedded.

Code for Apache (.htaccess)

Block requests directly:

# Prevent hotlinking - block requests
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?yourdomain\.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|webp|svg|pdf|mp4)$ - [F,NC,L]

Show alternative image:

# Prevent hotlinking - show alternative image
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?yourdomain\.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|webp)$ /images/hotlink-blocked.png [R,NC,L]

Whitelist specific domains:

# Prevent hotlinking - whitelist specific domains
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?allowed-partner\.com [NC]
RewriteCond %{HTTP_REFERER} !^https?://.*google\. [NC]
RewriteRule \.(jpg|jpeg|png|gif|webp|svg)$ - [F,NC,L]

Code for Nginx

Block requests directly:

# Prevent hotlinking - block requests
location ~* \.(jpg|jpeg|png|gif|webp|svg|pdf|mp4)$ {
valid_referers none blocked server_names *.yourdomain.com;
if ($invalid_referer) {
return 403;
}
}

Show alternative image:

# Prevent hotlinking - show alternative image
location ~* \.(jpg|jpeg|png|gif|webp)$ {
valid_referers none blocked server_names *.yourdomain.com;
if ($invalid_referer) {
rewrite ^.*$ /images/hotlink-blocked.png redirect;
}
}

Limiting Image Quality in Google Images

If you've ever tried to copy or download an image from Google and, despite filtering by large size, the quality was mediocre, but when accessing the source website the image looked perfect, it wasn't an error or a coincidence: it was done deliberately.

It's a practice allowed by Google and is done similarly to hotlinking but returning a 204 for images when the referrer is from Google.

Here we can see a practical example of how it looks:
example of Google search

example of Google search, comparing the original and the result in Google Images

It's the same image, but on the left we see the original and on the right the result in Google Images.

In this case, it makes a lot of sense, because this way the user is forced to enter the website and even have to view the ads to see the content they're looking for on the website.

Here's a guide on how to pixelate images in Google Images if you want to know how to do the technical implementation.

Whitelist + return 204 for Google Images:

# Prevent hotlinking - whitelist + return 204 for Google Images
location ~* \.(jpg|jpeg|png|gif|webp)$ {
valid_referers none blocked server_names
*.yourdomain.com
*.google.com
*.google.es;
if ($invalid_referer) {
return 403;
}
# Optional: return 204 for Google Images specifically
if ($http_referer ~* "google\.com/imgres") {
return 204;
}
}

Conclusion

The referrer (or referer, in the context of the HTTP header) informs the destination page about the user's source page—in other words, where they came from.

While the source page can prevent this data from being sent, when we do receive it, we can put it to various uses as we have seen throughout this article, for example:

The best way to utilize it is by applying your imagination to the specific needs of your project. Information is power, and what the referrer provides is the insight into where your user is coming from.

Bibliography:

If you like this article, you would help me a lot by sharing my content:
Interested in Advanced SEO Training?

I currently offer advanced SEO training in Spanish. Would you like me to create an English version? Let me know!

Tell me you're interested
You might be interested in other articles:
SEO Articles
Usamos cookies para asegurar que te damos la mejor experiencia en nuestra web. Aquí tienes nuestra política de Cookies.