Back to blogs

How to Use Notion as a Blog CMS With Next js Setup

July 9, 2025
5 min read
How to Use Notion as a Blog CMS With Next js Setup

If you want a powerful, easy-to-manage blog that’s lightning-fast and SEO-optimized, combining Notion as your content management system (CMS) with Next.js for your frontend is a cutting-edge solution. This guide walks you through the latest best practices for building a CMS-powered blog site using Notion and Next.js, drawing from the most current resources and real-world developer experience.


Why Use Notion as a CMS with Next.js?


Notion is a flexible, user-friendly workspace that lets you create and manage content without technical barriers. Next.js is a React framework that excels at static site generation (SSG), server-side rendering (SSR), and SEO. When paired, you get:


  1. Intuitive content editing: Write and update posts in Notion’s rich editor.
  2. Seamless publishing: Content updates sync to your blog automatically.
  3. Blazing performance: Next.js delivers static pages for speed and SEO.
  4. Low cost: Notion’s free tier suffices for most personal or small business blogs.


Step 1: Set Up Your Notion Database


  1. Create a Notion Database
  2. Open Notion and create a new page for your blog content.
  3. Add a Database – Full Page block.
  4. Add properties for your blog posts:
  5. Title (text)
  6. Slug (text, for URLs)
  7. Tags (multi-select)
  8. Description (text)
  9. Published (checkbox or status)
  10. Date (date)
  11. Cover Image (files/media)


  1. Organize for SEO
  2. Use descriptive titles and meta descriptions.
  3. Add tags for topic categorization.
  4. Include a cover image for each post.


Step 2: Create a Notion Integration and Get API Access


  1. Register a Notion Integration
  2. Go to Notion Developers.
  3. Create a new integration and give it a name (e.g., “Blog CMS”).
  4. Copy the integration’s secret token.
  5. Share Database with Integration
  6. In Notion, open your blog database.
  7. Click “Share” and invite your integration to access the database (read permission is sufficient for most blogs).


Step 3: Set Up Your Next.js Project


  1. Initialize Next.js
  2. Run npx create-next-app@latest your-blog
  3. Navigate to your project: cd your-blog
  4. Install Dependencies
  5. Install the Notion SDK:
  6. npm install @notionhq/client
  7. Optionally, use libraries like notion-on-next or react-notion-x for easier rendering.
  8. Configure Environment Variables
  9. Add your Notion secret and database ID to a .env.local file:
NOTION_TOKEN=your_notion_secret
NOTION_DATABASE_ID=your_database_id


Step 4: Fetch Content from Notion


  1. Create a Data Fetching Utility
  2. Use the Notion SDK to query your database:
import { Client } from "@notionhq/client";
const notion = new Client({ auth: process.env.NOTION_TOKEN });

export async function getBlogPosts() {
const response = await notion.databases.query({
database_id: process.env.NOTION_DATABASE_ID,
filter: { property: "Published", checkbox: { equals: true } },
sorts: [{ property: "Date", direction: "descending" }],
});
return response.results;
}
  1. Fetch posts at build time using getStaticProps for optimal SEO and performance.
  2. Handle Images and Media
  3. Notion’s image URLs expire after 1 hour. Download images to your public folder or use a proxy/storage service (e.g., Supabase Storage) for reliability.


Step 5: Render Content in Next.js


  1. Create Blog Listing and Post Pages
  2. Use dynamic routing (pages/posts/[slug].js) to generate individual post pages.
  3. Render content blocks using a library like react-notion-x or custom components for full control.
  4. SEO Optimization
  5. Set , , and Open Graph tags dynamically for each post.
  6. Generate an XML sitemap and robots.txt for search engines.
  7. Use Next.js’s Image component for optimized images.


Step 6: Automate Updates and Deploy


  1. Incremental Static Regeneration (ISR)
  2. Use Next.js ISR to rebuild pages when content changes, keeping your site fresh without full redeploys.
  3. Example:
export async function getStaticProps() {
const posts = await getBlogPosts();
return {
props: { posts },
revalidate: 60, // Regenerate every 60 seconds
};
}
  1. Deploy to Vercel
  2. Deploy your site to Vercel for seamless integration with Next.js and automatic HTTPS.


Best Practices & Tips


  1. Performance: Use static generation for all public pages. Limit API calls at runtime.
  2. Image Handling: Always download or cache images to avoid broken links.
  3. Security: Never expose your Notion secret in client-side code.
  4. Content Workflow: Use Notion’s properties (e.g., “Published” status) to control what’s live.
  5. SEO: Optimize every page for keywords, metadata, and accessibility.
  6. Extensibility: Add features like search, comments, or analytics as your site grows.


Common Pitfalls

  1. Slow API Responses: Notion’s API isn’t the fastest; use SSG/ISR to avoid runtime delays.
  2. Image Expiry: Notion image URLs expire—always handle images proactively.
  3. Manual Rebuilds: Automate deployments or use ISR to avoid manual site rebuilds when publishing new posts.


Example Projects & Resources

  1. notion-on-next: Rapid Next.js + Notion starter.
  2. nextjs-notion-blog-starter: SEO-optimized starter with dynamic sitemap.
  3. Official Notion API Docs.


Conclusion

Combining Notion and Next.js gives you a modern, maintainable, and SEO-friendly blog platform. You get the best of both worlds: a delightful writing experience in Notion and a high-performance, scalable frontend with Next.js. By following the steps and best practices above, you can launch a professional blog that’s easy to update and optimized for search engines in 2025.


Ready to start? Set up your Notion database, connect it to Next.js, and watch your content shine online!

Notion CMSNext.js blogSEO-friendly blog using Notionblog CMSintegrate Notion API with Next.jsstatic blog with Notion and Next.jsReact blogfetch blog posts from Notion databasedeploy Notion blog on Verceloptimize Next.js blog for SEOuse Notion as a headless CMSautomate blog updates using ISR

Recent Blogs

View All