Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/canonical-present-noindex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@advance-labs/scoring": patch
---

`tech.canonical-present` no longer asks `noindex` pages for a canonical (its own text says "every indexable page"). `tech.canonical-resolves` and `tech.indexable` still see noindex pages. Found auditing aeo.advancelabs.dev, where `/login` (noindex, nofollow) failed the rule.
10 changes: 9 additions & 1 deletion packages/scoring/src/noindex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,16 @@ describe('indexability rules still see noindex pages', () => {
expect(f?.passed).toBe(false);
});

it('canonical-present keeps inspecting noindex pages', async () => {
it('canonical-present does not ask a noindex page for a canonical', async () => {
const f = (await findings(withLogin())).get('tech.canonical-present');
expect(f?.affectedUrls ?? []).not.toContain(LOGIN);
});

it('canonical-resolves still inspects noindex pages (a malformed canonical is flagged)', async () => {
const ctx = withLogin();
ctx.pages = ctx.pages.map((p) => (p.url === LOGIN ? { ...p, meta: { ...p.meta, canonical: 'not a url' } } : p));
const f = (await findings(ctx)).get('tech.canonical-resolves');
expect(f?.passed).toBe(false);
expect(f?.affectedUrls).toContain(LOGIN);
});
});
Expand Down
6 changes: 3 additions & 3 deletions packages/scoring/src/technical-seo-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ export const technicalSeoRules: Rule[] = [
title: 'Canonical URL is declared',
description: 'A canonical tag consolidates duplicate URLs to one preferred address.',
recommendation: 'Add <link rel="canonical"> to every indexable page.',
// Canonical checks keep seeing noindex pages: a canonical on a page you meant to index is
// exactly what they verify, and pages are only excluded from scoring, not from inspection.
includesNoindexPages: true,
// Scored without noindex pages: its own recommendation says "every indexable page", and a page
// that opted out of search has no use for a canonical. (An accidental noindex is caught by
// tech.indexable, which does see those pages.) canonical-resolves below still sees them.
evaluate: (ctx) => {
const missing = pagesFailing(ctx, (p) => Boolean(p.meta.canonical));
return missing.length === 0 ? { passed: true } : { passed: false, affectedUrls: missing };
Expand Down
Loading