What actually got my Next.js portfolio indexed

Not a checklist of SEO myths. The six things I changed on this site that took it from invisible to indexed in Google Search Console, with the parts that did not matter.

Articles

October 30, 2026· 8 min readNext.jsNext.jsSEOSearch ConsolePerformance

This site is a Next.js 16 App Router project. It is also my first site where I cared about being found, so I did the work properly and watched Search Console to see what moved.

The result: the property is verified, the sitemap is submitted and accepted, and Google discovered every page I listed. Here is what mattered, and what did not.

1. One canonical URL per page, and both languages declared

Every page exists twice, /en/... and /ar/.... Without a canonical, that looks like duplicate content, and the two versions compete with each other.

The metadata for each page declares its canonical and its alternates:

alternates: {
  canonical: `/en/projects`,
  languages: { en: `/en/projects`, ar: `/ar/projects`, "x-default": `/en/projects` }
}

x-default is the part people forget. It tells Google which version to serve to someone whose language is neither.

2. A sitemap that lists only real pages

The sitemap is generated, not written by hand, and it is generated from the same list of pages the nav uses. When I removed pages, they left the sitemap in the same commit. A sitemap full of 404s is worse than no sitemap: it wastes the crawl budget and it tells Google your site is unreliable.

Each entry carries the language alternates, so the two versions are understood as one page in two languages rather than two pages.

3. Removing pages means a redirect, not a 404

I folded a few pages into the home page. Those URLs had been live, so they got permanent redirects to the language home:

{ source: "/:lang(en|ar)/about", destination: "/:lang", permanent: true }

A 301 passes the ranking to the destination. A 404 throws it away. That is the whole reason the redirect list exists in the config.

4. Content has to be in the HTML

This is the one that actually decided whether the site could be read. The site content comes from a database through a REST call, revalidated every 60 seconds, and it is rendered on the server. View source on any page and the text is there.

The failure mode I avoided: a client component that fetches its content in useEffect. That page looks perfect in a browser and looks empty to a crawler that does not run JavaScript, and it delays everything for the crawler that does.

Same reason the entrance animations are CSS animations rather than a JavaScript reveal. If the first screen is hidden until a script runs, the first screen is not in the HTML.

5. Unique titles and descriptions, per page, per language

Every page builds its own metadata: title, description, canonical, Open Graph, Twitter card, and an image. Not one shared description across the site.

That is not a trick for ranking. It is what makes a result readable in a list of results, and it is what makes two pages distinguishable at all. A site where every page says "Andrew Nashaat - Software Engineer" is a site where only one page can win.

6. Analytics that do not cost the score

The Google tag is in the site, and it is deferred: it loads on the first interaction, or after fifteen seconds if nobody touches anything. On a portfolio, most visitors scroll or click, so the tag still records them.

That deferral is worth roughly twenty performance points on mobile, because the tag is the heaviest third-party script on the page and it is not needed to render anything.

What did not matter

  • Keyword stuffing in the meta description. Nobody reads it, Google rewrites it anyway.
  • Submitting the URL repeatedly. One submission, then let the sitemap do its job.
  • The mobile performance score by itself. Lighthouse mobile reports around 79 on this site, and it is simulated throttling on a page with real fonts and real images. Desktop is 100. The score is a signal, not a verdict, and chasing 100 on mobile usually means deleting the design.
  • The `robots.txt` file beyond one line. Mine allows everything and points at the sitemap. That is the whole file.

The order I would do it again

  1. Server-rendered content, so there is something to index.
  2. Canonical plus hreflang on every page.
  3. A generated sitemap of real pages only.
  4. Permanent redirects for anything that moved.
  5. Unique metadata per page.
  6. Verify the property in Search Console, submit the sitemap once, and read the coverage report a week later.

Six steps, no tools to buy, and the site is now discoverable by name and by the things I actually write about.

The unglamorous truth: indexing is a consequence of a site that is readable, consistent and honest about which URLs exist. There is no trick that survives a broken structure.

→ All articles