How to show up on Google with SSG Next.js web application

Updated at

0 comment(s)

This web application is statically generated SPA, built using Next.js. For some reason, my blog posts would not show up on Google, even though using a sitemap generator and adding that sitemap to Google Search Console.

I had a hunch that the SPA factor might be the failing piece, so I investigated turning it into a MPA - which is how the site works anyway. The goal is to disable all client-side javascript.

This is done via two steps.

  1. Add the snippet below to all next.js pages
  2. Run next export after build
  3. Deploy the out folder to your hosting provider
export const config = {
  unstable_runtimeJS: false
}

Now you just need to give it time. Even if you trigger a indexing event via Google Search Console, you will still need to wait days to see the effect.

This blog post explains it all in a good manner!

Andreas Jilvero AB
Västmannagatan 44
113 25 Stockholm
Organisationsnummer: 559237-3004
Phone number: 076 035 90 11
  • Mail
  • Github
  • LinkedIn