Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we exclude rel=nofollow by default? #309

Open
tunetheweb opened this issue Apr 15, 2024 · 6 comments
Open

Should we exclude rel=nofollow by default? #309

tunetheweb opened this issue Apr 15, 2024 · 6 comments

Comments

@tunetheweb
Copy link

We've discovered that WooCommerce "add to basket" buttons are regular links. Now of course that breaks all sorts of GETs should be idempotent but such is the web.

They do implement a rel=nofollow to prevent search engines following such links. We're going to add it to our WordPress plugin, but I wonder if that's something we should do by default since it seems like a good sign that it's unexpected to be followed by bots and only by real humans.

Not sure if this is a spec question, or should be up to individual implementers so raising here first.

@tunetheweb
Copy link
Author

Relevant WordPress issue: WordPress/performance#1140

@domenic
Copy link
Collaborator

domenic commented Apr 16, 2024

I like this idea in theory. But I can't think of how we would reasonably specify it or explain it. "You said to prerender 'all links matching the /* URL pattern', but what we believe you meant was 'all links matching the /* URL pattern and without rel="nofollow"'. We'd need some concept of... default conditions which get anded onto any that are supplied?? And some way of undoing those???

Maybe it's best to just take this as good advice for when we create examples and documentation? Not sure.

@tunetheweb
Copy link
Author

Well I was thinking it would only be for document rules and wouldn't be overridden. In the same way that "href_matches": "*" doesn't match external links for document rules even thought you said * (i.e. everything).

But we could add a "include-nofollow": true setting that defaults to false for those that did want to override it?

@domenic
Copy link
Collaborator

domenic commented Apr 17, 2024

In the same way that "href_matches": "*" doesn't match external links for document rules even thought you said * (i.e. everything).

It does match :)

@tunetheweb
Copy link
Author

It does match :)

I'm confused.

This example: https://prerender-demos.glitch.me/document-rules.html has this:

  <p><a href="next.html">This link should be eligible to be prerendered</a></p>
  <p><a href="next2.html">This link should also be eligible to be prerendered</a></p>
  <p><a href="https://www.example.com">This link is external and should not be eligible</a></p>

  <script type="speculationrules">
    {
      "prerender": [
        {
          "where": {"href_matches":"*"},
          "eagerness": "moderate"
        }
      ]
    }
  </script>

But shows this in devtools:

image

So the external link is excluded from the list of potential speculations? And that makes sense to me as the URL pattern has a base of the document AFAIK.

@domenic
Copy link
Collaborator

domenic commented Apr 18, 2024

You're right, that's because * doesn't mean everything, it means URLs which match the current URL plus a * segment at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants