Article

How to Build an SEO-Optimized Blog Using Next.js App Router (Explained Simply)

·4 min read min read·👁 23
Dharmendra Singh Yadav

Dharmendra Singh Yadav

Founder, Dharmsy Innovations

How to Build an SEO-Optimized Blog Using Next.js App Router (Explained Simply)

If you want to build a blog that loads fast, ranks on Google, and is easy to maintain, the Next.js App Router is honestly one of the best ways to do it.

But just using Next.js doesn’t automatically give you SEO — you need to set things up the right way.

So here’s a simple, human-friendly guide on how to build an SEO-optimized blog using Next.js App Router.

No complicated jargon. No unnecessary theory. Just what actually matters.

1. Start With a Clean Folder Structure

Your blog will usually look like this:

/app
/blog
/page.tsx → shows all blog posts
/[slug]/page.tsx → shows single blog post

A clean structure makes routing simple and helps with SEO hygiene.

2. Make Your Blog Pages Server Components

Blog pages don’t need interactivity, so they should be Server Components.

Why?


  1. They load faster
  2. They improve SEO
  3. They don’t send JavaScript to the browser
  4. Google loves server-rendered content

Example:

export default async function BlogPage() {
const posts = await getPosts();
return <BlogList posts={posts} />;
}

No "use client" needed.

3. Choose Where Your Content Lives

You can store your blog content in:

✔ MDX files (Markdown that supports React)

Great for simple blogs.

✔ A database (Mongo, Postgres)

Useful for dashboard + admin panels.

✔ A CMS (Sanity, Strapi, Contentful)

Great if your content editors aren’t developers.

Pick whatever suits your workflow.

4. Use Next.js Metadata API (Major SEO Boost)

Next.js has built-in SEO tools.

Use them.

Inside your /blog/[slug]/page.tsx:

export async function generateMetadata({ params }) {
const post = await getPost(params.slug);

return {
title: post.seoTitle,
description: post.seoDescription,
openGraph: {
title: post.seoTitle,
images: [post.banner],
},
};
}

This gives your blog:

  1. SEO title
  2. SEO description
  3. OG preview
  4. Twitter cards

All automatically.

5. Use Clean, SEO-Friendly URLs

Good:

/blog/how-to-build-seo-blog
/blog/nextjs-performance-tips

Avoid messy URLs:

/blog/post?id=231
/blog/article-1234

Google rewards clean URLs.

6. Optimize Your Banner Image

Your blog’s banner image directly affects your SEO score.

Use next/image:

<Image
src={post.banner}
width={1200}
height={630}
priority
alt={post.title}
/>

This fixes:

  1. Slow loading
  2. LCP issues
  3. CLS layout shifts

7. Add Structured Data (JSON-LD)

You don’t need to know SEO deeply — just add this code inside your blog post:

<script type="application/ld+json">
{JSON.stringify({
"@context": "https://schema.org",
"@type": "Article",
headline: post.title,
description: post.description,
image: post.banner,
datePublished: post.date,
author: "Your Name",
})}
</script>

This helps your blog appear in:

  1. Google rich results
  2. Article previews
  3. Better rankings

8. Use a Table of Contents for Long Blogs

A TOC helps both humans and Google.

Benefits:

  1. Easy navigation
  2. Google understands your sections
  3. Higher ranking for multiple keywords

9. Use ISR (Incremental Static Regeneration)

This makes your blog super fast and still automatically updated.

export const revalidate = 60;

Your page becomes static, but updates every 60 seconds.

10. Avoid Too Many Client Components

Client components add JavaScript → JavaScript slows down SEO.

Blogs should be mostly Server Components, and only tiny things like:

  1. Dark mode switch
  2. Sharing pop-up
  3. Comments section

should be client-side.

11. Add Social Share Preview (OG Image)

This improves:

  1. Click-through rate
  2. Social sharing
  3. Branding

Next.js lets you generate this automatically using:

opengraph-image.tsx

12. Fix Core Web Vitals (LCP, CLS, TTI)

These matter a LOT for ranking.

✔ LCP fix:

Use priority on banner images.

✔ CLS fix:

Always give your images width + height.

✔ TTI fix:

Keep JavaScript small (use fewer Client Components).

13. Add Search Functionality

This improves:

  1. User experience
  2. Time spent on site
  3. SEO indirectly

A simple filter works:

posts.filter(post =>
post.title.toLowerCase().includes(query)
);

14. Add Sitemap and Robots.txt

Must-have for SEO.

sitemap.ts:

export default async function sitemap() {
const posts = await getPosts();
return posts.map(post => ({
url: `https://yourdomain.com/blog/${post.slug}`,
lastModified: new Date(),
}));

robots.txt:

User-agent: *
Allow: /

15. Enable Analytics & Search Console

Insights help improve ranking.

Use:

  1. Google Search Console
  2. Vercel Analytics
  3. Vercel Speed Insights

These show real SEO issues in production.

Work with Dharmsy Innovations

Turn Your SaaS or App Idea Into a Real Product — Faster & Affordable

Dharmsy Innovations helps founders and businesses turn ideas into production-ready products — from MVP and prototypes to scalable platforms in web, mobile, and AI.

No sales pressure — just honest guidance on cost, timeline & tech stack.