Blog
    By Gabriel CA
    4 min read

    Next.js SEO: making pages crawlable and improving page speed

    Next.js SEO: making pages crawlable and improving page speed

    Where Next.js builds a page's HTML shapes how crawlers see it. The App Router uses React Server Components by default. Next.js lets you choose how each page renders.1

    Choosing how pages render

    Server-rendered pages give crawlers complete HTML when they arrive. Client-rendered pages may show an almost empty shell until JavaScript runs.1

    Google uses a slower second pass to render those shells. Many other crawlers and social link previews do not run JavaScript.1

    Static Site Generation, or SSG, builds HTML before visitors request it. A content delivery network then serves those saved files.2

    Use SSG for marketing pages, blogs and catalogues that rarely change. Crawlers receive ready-made HTML, but edits only appear after another build. Schedule builds or link them to your content system's publishing events.2

    Incremental Static Regeneration, or ISR, suits product catalogues that change on a schedule. It refreshes pages at set intervals, balancing fresh prices with low server load.1, 2

    Server-Side Rendering, or SSR, creates HTML for every request. It suits dashboards that need current data, but can increase the wait for the first byte.2

    SSR keeps even minute-to-minute changes visible to search engines. Heavy traffic puts more load on the server. You can mix SSG, ISR and SSR within one project.2

    Page metadata and canonical URLs

    The Pages Router uses <Head> tags spread across page components. Those separate blocks become harder to maintain as a site grows.2

    The App Router brings this work together through metadata objects or generateMetadata functions. Next.js merges these across nested layouts, reducing missed title updates.2

    Set page titles and meta descriptions on the server.3 Set a canonical URL on every page to help consolidate duplicate signals. Next.js does not set the correct canonical URL for you.3, 4

    An incorrect canonical tag can lead Google to treat pages as duplicates and leave them out of its index. Google may still choose a different canonical URL when your tag is correct.3

    Set metadataBase in the root layout. This makes relative Open Graph and canonical URLs resolve correctly across routes.4

    Sitemaps, robots files and search context

    Use sitemap.ts and robots.ts through the Next.js metadata file rules. Next.js serves them at /sitemap.xml and /robots.txt.4

    Keep the sitemap dynamic and the robots file up to date. Missing or neglected files can slow the indexing of new pages.3

    Add JSON-LD structured data to help search engines understand page content. It also helps them assess whether a page can appear in rich results.4

    For stores serving several languages or regions, use language alternates such as hreflang. Missing alternates can harm indexing and affect which regional page ranks.3

    Page speed, images, fonts and caching

    Use the Core Web Vitals report in Google Search Console to assess page speed with field data. The report reflects what real users experience. Do not rely on local Lighthouse scores alone.1

    Use the Next.js Image component to handle image optimisation. Give images clear alt text and size them to fit the screen.2

    Meaningful alt text supports access needs and gives image search more context. Reserve image dimensions to limit layout shifts as images load.4

    Use next/font to host fonts on your own site. It helps reduce layout shifts from font loading.4

    Plan caching around how content moves across the network. Poor caching can miss speed gains and use more server resources than needed.3

    How your CMS connects to Next.js affects page rendering and SEO. Content structure, API responses, previews and publishing flows shape how reliably pages are built. They also affect metadata and how quickly search engines receive updates.3

    Store development and migration with Kraftwire

    Kraftwire provides online store development. Kraftwire also provides platform migration.

    These stores are designed to turn browsers into buyers. Kraftwire handles moves from WordPress, Framer and Webflow. Its migration service is designed to preserve SEO and content.5

    Kraftwire provides API development. Kraftwire also provides cloud solutions.5

    Sources

    1. qubizen.com
    2. strapi.io
    3. focusreactive.com
    4. adeelhere.com
    5. kraftwire.com

    FAQ

    How does the Next.js App Router manage metadata and canonical tags?

    It merges exported metadata objects or generateMetadata functions across nested layouts. Set canonical URLs explicitly on every page. The metadataBase setting in the root layout makes relative canonical and Open Graph URLs resolve correctly.

    How should images and fonts be optimised in Next.js to protect Core Web Vitals?

    Use the Next.js Image component with clear alt text, responsive sizing and reserved dimensions. Reserved dimensions help limit image layout shifts. Use next/font to self-host fonts and reduce shifts from font loading.