Next.js Discord

Discord Forum

not-found.js file Status Code: 200 vs 404

Unanswered
Artzeeker posted this in #help-forum
Open in Discord
I work for a job-finding company and use Next.js 13.5 (App Router). I want to display a 404 page for job pages that either don't exist or have expired. According to Next.js documentation, it states that:

The not-found file is used to render UI when the notFound function is thrown within a route segment. Along with serving a custom UI, Next.js will return a 200 HTTP status code for streamed responses, and 404 for non-streamed responses.

Ref: [Next.js not-found](https://nextjs.org/docs/app/api-reference/file-conventions/not-foundv)

I am concerned about the impact on our Search Engine Results Page (SERP) and my SEO team requires me to return a 404 status code. However, my project is designed for streamed responses, which always results in a code 200 (because the root layout always renders first). My question is, will returning a 200 status code for not-found content negatively affect SEO? Are there any resources I can refer to for more information on this matter?

0 Replies