fix: stop private squads and gated pages from being indexable#6322
Merged
idoshamun merged 2 commits intoJul 14, 2026
Merged
Conversation
The global `additionalMetaTags` robots entry in `defaultSeo` was keyed by meta name rather than `key="robots"`, so it escaped next/head's dedupe and overrode every page's noindex with a stray `index, follow` tag — private squads still emitted `index, follow` despite the page setting noindex. - Move robots directives off `additionalMetaTags` onto next-seo's first-class handling: add a shared `robotsProps` (max-* directives) and pass it to both `DefaultSeo` and the page-level `NextSeo` in `_app.tsx`, so exactly one `robots` tag is emitted per page and page-level noindex always wins. - Add a shared `noindexSeoProps` constant and apply it to auth-gated / crawler-inaccessible pages (following, settings/**, bookmarks/**, my-feed, squads/discover/my, feed edit, team feedback) so they emit noindex,nofollow. - Add regression tests for the single robots tag / max-* survival, the squad GSSP noindex flags, and the gated-page seo lock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
Private squads (and other auth-gated pages) were emitting
index, followdespite the squad page already settingnoindex/nofollow.Root cause
defaultSeoinjected a globalrobotstag viaadditionalMetaTags. next-seo keys those by meta name, notkey="robots", so next/head never deduped it against the page-level native robots tag. Every noindex page therefore rendered two robots tags — the correctnoindex,nofollowand a strayindex, follow, max-snippet…— and the stray one won in practice.Changes
additionalMetaTagsonto next-seo's first-class handling: add a sharedrobotsProps(themax-*directives) and pass it to bothDefaultSeoand the page-levelNextSeoin_app.tsx. Now exactly onerobotstag is emitted per page and page-levelnoindexalways wins.noindexSeoPropsconstant and spread it into theseoof auth-gated / crawler-inaccessible pages:following, allsettings/**,bookmarks/**,my-feed,squads/discover/my,feeds/[slugOrId]/edit, andteam/**feedback.max-*survival (viaHeadManagerContextto exercise the real next/head dedupe), squad GSSP noindex flags, and a gated-page seo lock.Key decisions
_app's server-renderedNextSeo), not inSettingsLayout. A singleNextSeoin the shared layout looked tempting, butSettingsLayoutreturnsnull/an auth wall for unauthenticated requests and settings pages have nogetServerSideProps— so during SSR (what crawlers receive) it wouldn't render, dropping noindex from the initial HTML.index,followwith themax-*directives byte-preserved.null → undefinedcoercion inteam/feedback.tsxrequired by the strict typecheck guard once the file entered scope.Closes ENG-1862
Created by Huginn 🐦⬛
Preview domain
https://eng-1862-private-squads-still-ha.preview.app.daily.dev