"rel=nofollow noopener" - Possible to have both at the same time?
Asked Answered
S

1

17

I've got a pdf that I'd like to protect and don't want search engines to index it.

Currently, my link is as follows:

<a href="https://example.com/mypdf.pdf" target="_blank" rel="noopener">View PDF</a>

Would I be able to add nofollow tag to the rel tag?

Would I then divide these two with a coma or no coma?

Currently trying rel=nofollow noopener without coma.

Would I be able to add noindex to the same tag?

<a href="https://example.com/mypdf.pdf" target="_blank" rel="nofollow noindex noopener">View PDF</a>

Would this work?

Sherry answered 23/8, 2017 at 3:9 Comment(1)
Yes you can, please read this alternate answer hereProbabilism
T
34

"nofollow" tag tells search engines "don't follow this link."

"noreferrer" tag indicates no referrer information to be leaked on this link.

"noopener" tag prevents the new page from being able to access the window.opener property (preventing malicious javascript).

you can use both something like this:

<a href="https://example.com/mypdf.pdf" target="_blank" rel="nofollow noopener">View PDF</a>

"noindex" you can't noindex a link. That would have to be defined on-page, in the meta data.

You're better off blocking pages in robots.txt if that's what you're after.

User-agent: * 
Disallow: /mypdf.pdf
Talbott answered 23/8, 2017 at 8:28 Comment(1)
According to MDN Doc noreferrer implies noopener but does noopener implies nofollow(or vice-versa)? I see no info about that but I would like a confirm if it's not implied in any of the both ways.Nievesniflheim

© 2022 - 2024 — McMap. All rights reserved.