<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Agnel Nieves - Canonical</title>
    <link>https://agnelnieves.com/blog/tag/canonical</link>
    <description>Blog posts on Canonical by Agnel Nieves.</description>
    <language>en-US</language>
    <lastBuildDate>Mon, 17 Aug 2026 19:01:28 GMT</lastBuildDate>
    <atom:link href="https://agnelnieves.com/blog/tag/canonical/feed.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title><![CDATA[Google Thought My Archive Was the Homepage]]></title>
      <link>https://agnelnieves.com/blog/google-thought-my-archive-was-the-homepage</link>
      <guid isPermaLink="true">https://agnelnieves.com/blog/google-thought-my-archive-was-the-homepage</guid>
      <description><![CDATA[Search Console said duplicate page with a proper canonical. Six of my own URLs were pointing at /. Here is the Next.js leak, and why I flipped four reprints back to Promptway.]]></description>
      <content:encoded><![CDATA[<p>Search Console handed me a status I already knew by name: <a href="https://support.google.com/webmasters/answer/7440203#duplicate_page_with_proper_canonical_tag">Duplicate page with proper canonical tag</a>. I assumed it was the four reprints I had pointed at this site from <a href="https://promptway.com">Promptway</a>. That was half the story. The other half was worse.</p>
<p>I curled the live HTML. <code>promptway.com/blog</code> said its canonical was <code>https://promptway.com</code>. So did <code>/authors</code>. So did <code>/authors/agnel-nieves</code>, <code>/authors/diego-ferraro</code>, and the rest of the writer pages. Google was doing exactly what I asked: treating the archive and the writer pages as copies of the homepage, and refusing to index them.</p>
<p>This is the sequel to <a href="https://promptway.com/blog/from-invisible-to-indexed">From Invisible to Indexed</a>. That piece was about the domain serving the wrong product. This one is about the product serving the wrong address on its own pages.</p>
<h2>What a &quot;proper&quot; canonical actually means</h2>
<p>The status is not an error. Google is saying: this URL has a canonical pointing somewhere else, we agree, we will not index this one. When that is a <code>/blog/slug.md</code> alternate, or a trailing-slash redirect, you want that outcome. When it is <code>/blog</code>, the page you put in the sitemap as the archive, you do not.</p>
<p>I had done the sitemap work. I had <code>index, follow</code> on those routes. None of that matters if the <code>&lt;link rel=&quot;canonical&quot;&gt;</code> says &quot;the real page is <code>/</code>.&quot;</p>
<p>The Next.js metadata docs are explicit about this. Metadata objects <a href="https://nextjs.org/docs/app/api-reference/functions/generate-metadata">shallow-merge down the tree</a>, and nested fields like <code>alternates</code> get replaced by the last segment that defines them. They do not get replaced by a page that never mentions them. A root layout with <code>alternates.canonical: &quot;/&quot;</code> becomes the canonical of every child that forgets to set its own.</p>
<p>I had set self-canonicals on <code>/about</code>, <code>/tools</code>, <code>/subscribe</code>, the pillar pages, and every article. I had not set them on <code>/blog</code>, <code>/authors</code>, or <code>/authors/[slug]</code>. Those three inherited the homepage. Production HTML confirmed it.</p>
<p><code>og:url</code> had the same leak. The root layout set <code>openGraph.url: &quot;/&quot;</code>, and pages that never defined their own <code>openGraph</code> object inherited the homepage as the social URL. Google treats <code>og:url</code> as a secondary canonical hint. I pulled that field off the root layout too.</p>
<h2>The four reprints pointing the wrong way</h2>
<p>The Search Console bucket also held four articles I had published first here and then reprinted on Promptway with <code>canonical</code> pointing back:</p>
<ul>
<li><a href="https://promptway.com/blog/from-invisible-to-indexed">From Invisible to Indexed</a></li>
<li><a href="https://promptway.com/blog/optimizing-your-site-for-ai-agents">Optimizing Your Site for AI Agents and LLMs</a></li>
<li><a href="https://promptway.com/blog/optimizing-for-ai-search-in-2026">Optimizing for SEO, AEO, GEO, and AI Search in 2026</a></li>
<li><a href="https://promptway.com/blog/connecting-claude-to-google-ads-and-ga4-via-mcp">Connecting Claude to Google Ads and GA4 via MCP</a></li>
</ul>
<p>That is the HackerNoon pattern. The original keeps the credit. I wrote <a href="https://promptway.com/blog/getting-your-writing-seen-beyond-your-own-site">Getting Your Writing Seen Beyond Your Own Site</a> arguing the opposite for the publication: Promptway is the hub, everywhere else is a spoke. I had applied the rule everywhere except to my own reprints.</p>
<p>So I flipped them. Promptway now self-canonicalizes. The copies on this site declare <code>canonical</code> at the Promptway URL, drop out of this sitemap, and show a visible &quot;Originally published on Promptway&quot; line in the header. <code>llms.txt</code> here lists the Promptway URL too, so agents that land on this domain still get pointed at the hub.</p>
<p>If you keep a reprint with an off-site canonical, do not submit it in your sitemap. Submitting it says &quot;index this URL.&quot; The page itself says &quot;index that other URL.&quot; Search Console will file the contradiction under the same status that started this post.</p>
<h2>The fix, in the order I would do it again</h2>
<ol>
<li><strong>Do not set <code>canonical</code> or <code>og:url</code> on the root layout.</strong> Keep feed auto-discovery there if you want. Put the homepage canonical on <code>app/page.tsx</code>.</li>
<li><strong>Give every indexable route a self-canonical.</strong> Archive, writers index, writer pages, pillars, tools, about, subscribe. If a page is in the sitemap, it needs its own address.</li>
<li><strong>Curl the rendered HTML.</strong> Do not trust the source file. I used Googlebot as the user agent and grepped for <code>rel=&quot;canonical&quot;</code>. The leak was obvious in one pass.</li>
<li><strong>Decide the hub before you syndicate.</strong> If Promptway is the home copy, this domain points there. If the personal essay is the home copy, do not put Promptway in the sitemap for that slug.</li>
<li><strong>Give markdown alternates a <code>Link: rel=&quot;canonical&quot;</code> header</strong> pointing at the HTML article. I want <code>/blog/&lt;slug&gt;.md</code> crawlable for agents. I do not want it competing as a search result.</li>
</ol>
<p>The www, http, trailing-slash, and <code>*.vercel.app</code> copies were already 308ing to the apex. Those were fine. The bug was inside the HTML I was proud of.</p>
<h2>What I am watching now</h2>
<p>After deploy I will request indexing on <code>/blog</code>, <code>/authors</code>, and each writer page on Promptway. The four flipped articles get the same request there. On this site, those four URLs should move into &quot;Duplicate page with proper canonical tag&quot; and stay there. That is the correct status for a spoke.</p>
<p>I do not have the recrawl numbers yet. I will update this if Google disagrees with the new tags. Last time the domain pointed at the wrong product, the machines believed the tag. I am betting they will believe it this time too.</p>
]]></content:encoded>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <author>agnel@agnelnieves.com (Agnel Nieves)</author>
      <dc:creator><![CDATA[Agnel Nieves]]></dc:creator>
      <category>SEO</category>
      <category>AEO</category>
      <category>Canonical</category>
      <category>Search Console</category>
      <category>Next.js</category>
      <category>Indexing</category>
    </item>
  </channel>
</rss>