Skip to content
Ahmad Raza
Menu
All posts

6 min read

Getting Found: Product Page SEO for Next.js Stores That Actually Sell

A practical guide to product page SEO for Next.js eCommerce stores: server-rendered content, per-product metadata, canonical URLs, Product structured data, sitemaps, and sold-out items.

Getting Found: Product Page SEO for Next.js Stores That Actually Sell
On this page

A store can have great products, a fast checkout, and still get almost no traffic from Google.

Often the reason isn't the content. It's the plumbing. Product pages render their details in the browser, every color and filter creates a "new" page, titles all say the store name, and sold-out products quietly turn into 404s.

None of this is visible to the founder looking at the site. It's very visible to a search engine.

Here's how I approach product page SEO on Next.js stores, without tricks, just making the pages clear and honest.

Where Product SEO Usually Goes Wrong

Most problems come from decisions that made sense for the frontend but were never checked from a search engine's point of view.

Common signs:

  • Product name, price, and description load after the page, from a client-side fetch
  • Every page has the same title, or just "Home | Store Name"
  • The same product is reachable at several URLs (with ?color=, ?ref=, sorting params)
  • Filter combinations on collection pages create thousands of thin pages
  • Sold-out or discontinued products return a 404 overnight
  • No structured data, or structured data with a price that doesn't match the page

Each one is small. Together they make it hard for Google to know which page to show and whether to trust it.

Render the Product on the Server

With the App Router, product pages are Server Components by default. Use that.

Fetch the product on the server and render the name, price, description, and main image in the initial HTML. Interactive parts like the variant picker, gallery, and add-to-cart button can still be Client Components.

A quick check: open the product page, view the page source (not DevTools), and search for the product name and price. If they aren't there, search engines are working harder than they should to understand the page.

Give Every Product Its Own Title and Description

Use generateMetadata in the product route so each page describes itself:

  • Title: product name plus one useful detail, then the store name. For example, "Leather Tote Bag in Tan, Large | Store Name"
  • Description: one or two plain sentences on what it is and who it's for, not a keyword list
  • Open Graph image: the main product photo, so links shared on WhatsApp or X show the actual product

generateMetadata and the page can call the same data function. Wrap it in React's cache so the product is fetched once per request, not twice.

Pick One URL Per Product and Say So

Variants and tracking parameters are the biggest source of duplicate pages on stores I work on.

If the selected variant lives in the URL (which is good for sharing), the product still needs one main address. Set a canonical URL in metadata:

  • alternates.canonical points to the clean product URL, like /products/leather-tote
  • Tracking params (?ref=, ?utm_source=) never change the canonical
  • Only give variants their own canonical if they're truly different products people search for separately (rare for size, sometimes true for color)

This tells Google, "these are all the same page, rank this one."

Be Careful With Filter and Sort URLs

Collection filters in the URL are great for buyers. Indexing every combination is not.

A simple rule set:

  • Main collection pages (/collections/bags) are indexable with a self-referencing canonical
  • Sorting params (?sort=price-asc) canonical back to the unsorted page
  • Multi-filter combinations get robots: { index: false, follow: true } in metadata
  • If one filter is a real search term, like "black bags", consider a dedicated collection page instead of relying on a filter URL

You keep the buyer experience and avoid flooding search results with near-identical pages.

Add Product Structured Data That Matches the Page

Structured data (JSON-LD using schema.org's Product type) helps search engines show price, availability, and ratings in results.

Render it on the server inside a <script type="application/ld+json"> tag, built from the same product data as the page. Include:

  • name, image, description, sku, and brand
  • An offers block with price, priceCurrency, availability, and the product URL
  • Ratings only if you actually show real reviews on that page

The rule that matters most: structured data must match what the buyer sees. If the page says Rs 4,500 and in stock, the JSON-LD says the same. Mismatches are worse than having none, because they make the whole page look unreliable.

Handle Sold-Out and Discontinued Products Honestly

Deleting a product page the moment stock runs out throws away whatever search visibility it built.

What I usually do:

  • Temporarily sold out: keep the page live, show "Out of stock" clearly, set availability to OutOfStock, and offer a back-in-stock signup or similar products
  • Permanently discontinued with a close replacement: redirect (308) to the replacement or the parent collection
  • Gone with no replacement: return a real 404 with notFound() and helpful links, not a soft 404 that looks like a normal page

Buyers landing from Google then see something useful instead of a dead end.

Generate a Sitemap From Your Real Catalog

Add an app/sitemap.ts that builds the list from your database or Shopify catalog:

  • Include active product pages and main collection pages
  • Use the product's real updatedAt for lastModified
  • Leave out filter URLs, cart, checkout, and account pages
  • Split into multiple sitemaps once the catalog gets large

Pair it with app/robots.ts that points to the sitemap and keeps checkout and account routes out of crawling.

Don't Forget Images and Speed

Product pages are mostly images, and they affect both search and conversion.

  • Use descriptive alt text: "Tan leather tote bag, large, front view", not "IMG_2041"
  • Use next/image with proper sizes so phones don't download desktop images
  • Mark the main product image as priority so it loads first

A fast product page helps rankings a little and helps buyers a lot. Both are worth it.

If You're on Headless Shopify

The same rules apply. A few extra notes:

  • Pull SEO title and description from Shopify's product SEO fields when they're filled in, and fall back to your own template when they aren't
  • Use the Shopify handle for your product URL so links stay stable
  • Make sure the old Shopify theme URLs redirect to the new storefront URLs if you're migrating

Migrations are where stores lose the most search traffic, almost always from missing redirects.

A Quick Test You Can Run Today

Pick your best-selling product and check:

  1. View page source. Are the name, price, and description in the HTML?
  2. Is the page title specific to that product?
  3. Add ?color=black&ref=test to the URL. Does the canonical still point to the clean URL?
  4. Paste the URL into Google's Rich Results Test. Does it find a valid Product with the right price?
  5. Mark a product sold out on staging. Does the page stay live and say so clearly?
  6. Open /sitemap.xml. Are your products there, without filter URLs?

Every "no" is a small, fixable reason Google is showing someone else's store instead of yours.

The Takeaway

Product page SEO isn't about keyword stuffing. It's about making each page clear: rendered on the server, with its own title, one main URL, structured data that matches the page, and an honest answer when something is sold out.

Next.js gives you all the tools for this out of the box. They just need to be wired up deliberately.

If your store has good products but product pages that barely show up in search, or you're planning a migration and want to keep the traffic you've earned, that's the kind of storefront work I help eCommerce brands get right.

  • 5 min read

    A 30-Day Agentic Commerce Rollout for a Next.js Store

    A practical, week by week plan to make a Next.js store ready for AI shopping agents: clean the data, ship a read only catalog MCP server, add carts, hand off to confirmed checkout, then log and cap everything.

  • 5 min read

    Fraud and Abuse When Agents Shop Your Checkout

    AI shopping agents look a lot like bots, and bots look a lot like agents. Here is how to tell them apart, where to put bot challenges, and why hosted checkout like Shop Pay is your best trust boundary.

  • 4 min read

    Hydrogen SDK vs Calling Storefront API Yourself in 2026

    Shopify's Hydrogen SDK now reaches beyond Remix and React Router into other frameworks. Here is what it gives you for agent ready storefronts, what a thin Next.js client gives you, and when each one pays off.