Add rel=nofollow to robots.txt-blocked links on crawlable pages#103
Merged
Conversation
The /u/ path is disallowed in robots.txt. Without nofollow, Google treats the link as a discovery signal it can't follow, then reports the page as "Blocked by robots.txt" or "Not found" in Search Console. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Feedback button (anonymous fallback for non-editors), the "What links here" backlinks dropdown item, and the creator/admin/editor badges all link to URLs disallowed in robots.txt (/c/*/feedback/, /c/*/backlinks/, /activity/<user>/). Without nofollow, Google discovers them as crawl candidates it can't follow, then flags the parent page in Search Console. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Fixes: #83 (the "Blocked by robots.txt" / "Not found" rows)
Summary
Google Search Console flags pages whose only inbound links are robots.txt-disallowed without
rel=\"nofollow\". Audited the templates rendered to anonymous crawlers (root,/c/<path>/, 404) and found seven<a>tags that hit Disallow patterns withoutnofollow:assets/templates/cotton/header.html— Sign in (/u/login/)assets/templates/404.html— "Sign In to Find Out" (/u/login/)pages/templates/pages/detail.html— Feedback button (/c/*/feedback/), "What links here" (/c/*/backlinks/), creator/admins/editors badges (/activity/<user>/)All of these are action/activity URLs we don't want indexed regardless, so adding
nofollowis the right fix (vs. removing the Disallow rules).The directory-detail action links are all gated by
{% if user.is_authenticated %}/{% if can_edit %}, so crawlers don't see them — no edit needed there.Adjacent (not in this PR)
wiki/lib/markdown.py:594-597deliberately skips action URLs in the user-content nofollow pass, on the assumption that robots.txt is enough. That's the same assumption Google is now pushing back on. Worth a follow-up if a user writes a markdown link like[edit me](/c/foo/edit/)in page content.Deployment
This PR should:
skip-deploy(skips everything below)skip-web-deployskip-daemon-deployTemplate-only change; no code paths or migrations.
🤖 Generated with Claude Code