fix(seo): noindex parameterised comparisons, keep bare /compare
25,193 schools make ~317 million pairs. The bare page stays indexable as the landing page for the head term; the parameter space goes noindex, follow so its outbound links still count. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015mWQnpye9F299NVRCCSRvj
This commit is contained in:
1 parent
51ce2d6373
commit
3816b92d06
3 files changed
+76
-7
No files matched your search
@@ -1642,3 +1642,21 @@ test('a school page canonicalises to its own slug on the www host', async ({ pag
|
||||
.getAttribute('href');
|
||||
expect(href).toMatch(/^https:\/\/www\.schoolcompare\.co\.uk\/school\/\d+-/);
|
||||
});
|
||||
|
||||
test('a bare /compare is indexable, a parameterised one is not', async ({ page }) => {
|
||||
await page.goto('/compare');
|
||||
await expect(page.locator('meta[name="robots"]')).toHaveCount(0);
|
||||
|
||||
const [a, b] = await twoPrimaryUrns(page);
|
||||
await page.goto(`/compare?urns=${a},${b}`);
|
||||
const robots = await page.locator('meta[name="robots"]').first()
|
||||
.getAttribute('content');
|
||||
expect(robots).toContain('noindex');
|
||||
expect(robots).toContain('follow');
|
||||
|
||||
// noindex but follow: the links out to each school page still count, so the
|
||||
// canonical must still be present and point at the bare path.
|
||||
const canonical = await page.locator('link[rel="canonical"]').first()
|
||||
.getAttribute('href');
|
||||
expect(canonical).toBe('https://www.schoolcompare.co.uk/compare');
|
||||
});
|
||||
Reference in new issue
Block a user