How to Add A Blog to Next.js

Author: Kieron McKenna · 0 min read · Jul 01, 2025

Adding a blog to your Next.js website is one of the smartest moves for boosting SEO and driving organic traffic. Blogging can significantly increase your site’s visibility – in fact, businesses that blog have been shown to boost web traffic by 55% and gain far more leads than those that don’t . But what’s the best way to integrate a blog into your Next.js app? In this guide, we’ll explore why an on-site blog is important and compare the main approaches to adding a blog to Next.js, from DIY solutions to headless CMS and a new integrated Opinly SDK solution. By the end, you’ll know how to add a blog to Next.js in a way that’s optimal for SEO and fits your team’s needs.

Why Your Next.js Site Needs a Blog (and SEO Considerations)

A blog isn’t just a “nice-to-have” – it’s a proven driver of traffic, leads, and authority for your business. Around 80% of businesses now use blogs as a marketing tool, and small businesses that blog can see over 100% more lead growth than those that don’t . Publishing useful, relevant content helps attract visitors through Google searches and establishes your brand as an expert.

SEO Benefits

A key benefit of adding a blog is improving your search engine rankings for topics related to your business. Each blog post is an opportunity to target specific keywords and answer questions your potential customers are searching for. Over time, a blog with quality content can significantly increase your overall SEO footprint. According to recent data, companies that publish content consistently are 13 times more likely to see positive ROI on marketing . In short, a Next.js blog can become an inbound traffic engine that works 24/7 for your business.

On-Domain vs Subdomain

It’s important where you host the blog. Many companies traditionally set up a separate blog (e.g. on a subdomain like blog.yoursite.com using WordPress or Ghost). However, from an SEO perspective, hosting your blog as a section of your main site (e.g. yoursite.com/blog) is often better for consolidating domain authority and traffic . Studies have shown that moving a blog from a subdomain to a subdirectory of the main site can dramatically boost organic traffic (one site saw a 40% traffic increase by switching to a subdirectory) . Conversely, splitting your blog onto a separate subdomain can lead to a drop in SEO performance (one company experienced a 47% drop in traffic after shifting their blog to a subdomain) . The reason is that search engines may treat a subdomain as a separate site, so your main site might not fully benefit from all the content and backlinks the blog generates .

Consistency and Branding

Beyond pure SEO, integrating the blog into your Next.js app means visitors get a seamless experience (same navigation, design, and domain). You avoid sending users to an external site or subdomain that feels disconnected from your product. This keeps potential customers on your main website, where they’re only a click away from your product or signup pages.

In summary, adding a blog to your Next.js site — and doing so under your main domain — is a smart strategy to boost organic traffic and engagement. Now, let’s look at the common ways to implement it.

Option 1: Building a Next.js Blog from Scratch (DIY Approach)

One way to add a blog to Next.js is the do-it-yourself approach, leveraging Next.js’s capabilities to create blog pages manually. In practice, this often means writing posts in Markdown or MDX files within the codebase and using Next.js to render them. For example, the official Next.js tutorial demonstrates how to set up a simple blog by storing Markdown files in a folder and utilising getStaticProps to generate pages for each post. Many developers also use MDX (Markdown with React components) for more flexibility in writing posts. This approach keeps your blog integrated at yourdomain.com/blog and gives you full control over styling and layout.

Pros of Manually Building Your Own Next.js Blog

Building the blog within Next.js means you have total control over the blog’s functionality and design. You don’t need any external services – the content lives in your repository (or a connected data source), and you can deploy it along with your site. For a personal blog or a small site maintained by developers, this can be a quick way to get started. It leverages Next.js features like static generation for excellent performance and SEO (pre-rendering the posts as HTML) . Some tools can help, such as content file systems (e.g. using Grey Matter to parse front matter in Markdown ) or generators that turn Markdown into pages.

Cons of Manually Building Your Own Next.js Blog

The DIY approach can become cumbersome as your content grows or if non-developers need to contribute. Each new post might require a code commit or adding a file to the repo and deploying the site. This workflow doesn’t scale well for teams where marketers or writers (who aren’t comfortable in Git) need to add content. As a recent guide noted, handling content in code with Markdown is tempting but “often becomes cumbersome and can quickly pose issues as the team grows and fewer technical people are onboarded to the project” . In other words, a developer might manage a few Markdown posts easily, but for a steady stream of content or multiple authors, you’ll start to feel pain: lack of a friendly editor interface, risk of formatting errors in Markdown, and no easy way to schedule posts for future publication.

Another limitation is maintenance and features. If you want typical blog features like tagging, search, an RSS feed, or an easy way to update SEO metadata, you will need to build these features manually or find suitable plugins. There’s also no built-in content scheduling or WYSIWYG editing in a purely static approach. Essentially, you’re reinventing a lot of CMS functionality if your blog needs grow beyond the basics.

When to choose Building Your Own Next.js Blog

A manual Next.js blog could be fine if you’re a developer doing a side project or your site needs a simple blog with low volume (and you’re okay handling content as code). You get simplicity and no external dependencies. However, if you anticipate frequent content updates, multiple authors, or simply want a smoother content editing experience, you may want to consider other options.

Option 2: Using a CMS or External Blogging Platform

To avoid managing content in code, many Next.js developers turn to a CMS (Content Management System) or a hosted blogging platform. This route offers a user-friendly interface for creating and editing posts, which can be a significant advantage for collaboration and productivity. There are two primary flavours here:

2a. Traditional Blogging Platforms on a Subdomain (e.g. WordPress, Ghost):

One straightforward way is to use a popular blogging platform, such as WordPress, Ghost, or Medium, and host your blog separately from your Next.js app. For example, you might set up a WordPress blog and link it as blog.yoursite.com or yoursite.com/blog via a reverse proxy or iframe. This gives you a full-featured blog with minimal coding – WordPress and Ghost have rich editing tools, themes, and plugins. It can be the quickest for non-technical content teams to start writing.

  • Pros: Little development effort to publish content. You leverage mature platforms with robust features (comments, RSS, SEO plugins, etc.) out of the box. Non-developers can write and publish freely in a familiar UI.
  • Cons: If hosted on a subdomain or external URL, you encounter the SEO split discussed earlier – your main Next.js site won’t fully benefit from the blog’s SEO. Maintaining a separate system also means inconsistent design/UX (unless you heavily customise the blog theme to match your site) and potential integration headaches. Readers may have a disjointed experience when switching between your app and the blog. Additionally, managing updates and security for a WordPress server (if self-hosted) or paying for a hosted plan is extra overhead if the sole goal is just having a blog. In many cases, companies end up on subdomains because it was technically easier, not because it’s better for SEO.

There are ways to use WordPress/Ghost in “headless” mode to integrate at a path (fetching posts via API), but those can get complex. Historically, setting up something like yourdomain.com/blog with WordPress required self-hosting and custom routing, which many dev teams avoided due to the complexity . So while a traditional blog platform is powerful, using it as a separate site is often not ideal for Next.js apps aiming for seamless integration and maximum SEO benefit.

2b. Headless CMS Integrated with Next.js (e.g. Prismic, Contentful, Ghost API):

Headless CMS are a modern alternative that decouples content management from presentation. With a headless CMS, your content editors use a dashboard (CMS interface) to write posts, and your Next.js app fetches that content via an API to render it in your site. Popular headless CMS options for Next.js blogs include Prismic, Contentful, Sanity, Strapi, or utilising Ghost as a headless CMS through its Content API. These allow you to keep the blog under your main domain (your Next.js app displays the posts at /blog/* routes) while still providing non-developers with a way to edit content.

  • Pros: Content management becomes user-friendly. Editors get rich text editors, media library, and workflows without touching code. The blog lives on your Next.js site (good for SEO and brand consistency) but content can be updated anytime via the CMS and delivered through API – often supporting preview and scheduling features. Many headless CMS are pretty flexible, so you can model content types beyond just blog posts if needed. For example, Prismic highlights that using a headless CMS enables both technical and non-technical people to collaborate easily and allows for quick content iteration without requiring code redeployment. This approach is scalable for larger blogs and teams.
  • Cons: The integration effort and complexity are higher than a simple static blog. You have to set up the CMS and then write Next.js code to query the CMS API and generate pages. Every CMS has its learning curve, and you’ll need to build the front-end of the blog (templates for listing posts, post pages, etc.) using the CMS’s data. Essentially, you trade writing Markdown for writing API queries and handling CMS SDKs. It’s not difficult for a developer, but it does take time. Also, headless CMS platforms can be overkill if you only need a straightforward blog. They often support much more (multi-language content, complex schemas, content scheduling, roles/permissions, etc.) – which is powerful but you might not use half of those features for a simple blog. There’s also cost to consider: while some CMS have free tiers, they can become costly SaaS subscriptions as your content or traffic grows.

In summary, using a CMS (traditional or headless) is a solid path if you want a more hands-off content workflow and a feature-rich blog. If you already have a favourite CMS or your organisation is comfortable with one, integrating it with Next.js is certainly doable, and many companies have successfully built Next.js blogs with a headless CMS. Just be aware of the trade-offs: either you maintain a separate blog site (simpler setup but weaker SEO integration), or you invest dev effort to tightly integrate a headless CMS (better for SEO and UX).

Option 3: Add a Blog with Opinly’s Next.js SDK (Integrated & AI-Powered)

What if you could get the best of both worlds: a blog that is seamlessly integrated into your Next.js app (on your main domain, using your design), without the burden of managing markdown files or building a CMS from scratch? This is precisely the problem the Opinly SDK aims to solve. Opinly is a new solution focused on Next.js blogs that provides a drop-in integration, combining the ease of a hosted platform with the benefits of an on-site blog.

What is Opinly? In a nutshell, Opinly offers an SEO platform with an SDK for Next.js. It lets you manage your blog content in an online dashboard (including writing posts, editing, and scheduling), and then publish those posts directly under a path on your Next.js site (e.g. yoursite.com/blog). The content is fetched via Opinly’s API and rendered using pre-built React components, so it appears to be part of your site. Unlike a general-purpose CMS, Opinly is specialised for blogs and SEO optimisation, including features like AI-assisted content generation and scheduling tools to plan your content calendar.

How Opinly Works for Adding A Blog To Next.js

Opinly’s integration is designed to be extremely simple for developers. You install the Opinly SDK packages (@opinly/backend and @opinly/next), add a couple of configuration lines, and drop in a Next.js route to handle your blog pages. For example, you’ll create a file like pages/blog/[...slug].tsx (or in the Next.js App Router, app/blog/[[...slug]].tsx), which uses Opinly’s provided component to render the blog content. The SDK takes care of fetching your posts (via an Opinly client using your API key) and even automatically generates SEO metadata for each post. You also configure an image proxy (so that any images in your posts are served from your domain via Opinly’s CDN) and a sitemap that auto-includes all your blog posts (user content). In short, Opinly handles the heavy lifting of content delivery and SEO optimisation, while you retain control of the front-end integration and URL structure. The integration does not require any separate CMS application or managing Markdown files locally – everything is handled through Opinly’s interface and delivered through the SDK to your Next.js app.

Benefits of Opinly

This approach yields several key advantages for teams who want to add a blog to Next.js quickly:

  • Main-domain SEO boost: Opinly serves your blog under a path on your site, so all that juicy SEO content lives on your primary domain (no subdomains). This aligns with the best practice of using subdirectories for SEO gain, similar to other “blog engine” solutions, which emphasise using your main domain for better SEO.
  • No Maintenance or Overhead: You don’t have to maintain a separate WordPress server or regularly deploy content changes. Opinly’s blog engine is cloud-based, so things like content hosting, updates, and performance optimisations are handled for you. It’s a zero-maintenance solution from the dev perspective – much like other headless blog engines that promise you’ll “never worry about security upgrades, hosting, or performance” .
  • Quick Setup: The SDK is designed for a plug-and-play setup. Integrating Opinly into a Next.js site can take only minutes. This is similar to other Next.js-focused blog engines that provide drop-in SDKs and APIs. By just installing the package and adding a config, you get a fully functional blog section. There’s no need to build out custom pages or learn a complex CMS framework.
  • Content Scheduling and Automation: One standout feature of Opinly is its built-in scheduling. You can write posts and set them to publish at a future date and time via the Opinly dashboard. Your Next.js site will automatically start showing the post when its publish time arrives (since Opinly’s backend knows when to make it live). This is great for planning an editorial calendar or drip-feeding content regularly without manual intervention. While some headless CMS support scheduled publishing, Opinly makes it a core feature – and importantly, this scheduling feature is free to use.
  • AI-Powered Content Creation: Opinly’s unique differentiator is the integration of AI tools to assist with content creation. Writing high-quality blog posts consistently can be challenging; Opinly offers AI blog generation assistance (for example, you might be able to generate a draft or outline with AI, or get SEO keyword suggestions). This can significantly accelerate content production for lean teams. Instead of starting from a blank page, you could leverage AI to produce a first draft and then refine it. Note: The Opinly platform provides these AI and SEO optimisation tools as a premium offering (subscription-based), but using the blog engine itself (publishing and scheduling content you write) is free. This means you can get your Next.js blog up and running at no cost, and optionally upgrade to include AI content generation features.
  • SEO Optimisation Built-in: Since Opinly is SEO-focused, it likely includes features like automatic metadata generation (for titles, descriptions), structured data, and an optimised blog template. The Opinly SDK provides a helper to easily generate SEO metadata for each post, including user content. Additionally, Opinly can auto-generate a combined sitemap that includes all your blog posts, helping search engines index your content【user content】. Essentially, it takes care of the technical SEO best practices out of the box so your blog can rank well. This spares you from manually configuring things like meta tags or XML sitemaps for the blog posts.

When to choose Opinly: If you are a developer or a small team that knows you need a blog for SEO (and all the benefits mentioned earlier) but don’t want to spend time building or maintaining the blog infrastructure, Opinly is a desirable option. It’s ideal when you want the blog to live quickly, want it to look integrated, and prefer to focus on creating content rather than coding a CMS. It’s also great if you appreciate having AI tools to help generate or optimize posts – that can be a game-changer for producing content consistently. In comparison to a heavy headless CMS, Opinly is more lightweight and focused specifically on blogging, which means less configuration and learning curve. And compared to using an external blog platform on a subdomain, Opinly keeps everything on your site for better SEO and user experience.

In short, Opinly’s Next.js SDK provides a streamlined path to add a fully-featured, SEO-friendly blog to your app with minimal dev effort. It combines the strengths of a headless CMS (easy content editing, scheduling) with the simplicity of a plug-in tool, plus the bonus of AI content generation when you need it.

Conclusion: Choosing the Best Blog Solution for Your Next.js Site

Adding a blog to Next.js can be done in multiple ways – the right choice depends on your project’s needs and resources:

  • If you prefer full control and are okay with a hands-on approach, you can build a blog section manually using Markdown/MDX or other static techniques. This keeps things simple but may become labor-intensive as you scale your content.
  • If you need a robust content editor for non-developers, a headless CMS integrated with Next.js (or even a traditional blogging platform) will make content management easier. You’ll benefit from a UI for writers and many built-in features, at the cost of more setup and possibly maintaining another service.
  • If you want a quick, SEO-optimized blog with minimal fuss, a specialized solution like Opinly offers a happy medium. You get an on-domain blog that’s essentially ready to go – just plug in the SDK – and you can leverage powerful features like scheduling and AI content generation to supercharge your content marketing.

Remember, whichever approach you choose, the goal is to start publishing useful content consistently. A well-integrated blog will help attract and educate your audience, improve your search rankings, and ultimately drive more conversions. Given that companies with active blogs generate substantially more leads and traffic , investing the time to add a blog to your Next.js site is absolutely worth it.

Ready to Start Blogging?

If you’re leaning towards a hassle-free, integrated solution, Opinly’s Next.js Blog SDK is a great place to start. You can try Opinly for free – set up your blog and content schedule without any upfront cost. (The core blogging platform and scheduling features are free to use, and you can opt into the AI-powered content tools with a subscription whenever you’re ready for that boost.) With Opinly, you can have a Next.js blog up and running in minutes and start populating it with SEO-friendly posts right away. Don’t let the technical setup hold you back from the benefits of blogging. Give it a try, and watch your Next.js site grow with fresh content and improved search visibility. Happy blogging!

FAQS

  • What’s the easiest way to add a blog to an existing Next.js app?

    It depends on your goals. You can DIY with Markdown/MDX, use a headless CMS, or host on a subdomain—but Opinly lets you drop an SEO-optimized blog under /blog with minimal setup and no separate CMS.

  • Should I use Markdown files or a CMS for a Next.js blog?

    Markdown works well for simple static sites, but it quickly becomes cumbersome for larger teams or frequent publishing—requiring code commits and deployments each time content changes. Opinly and other CMS solutions remove that hurdle with a dedicated dashboard and dynamic rendering.

  • Do I lose SEO value if I host a blog on a subdomain instead of on the main Next.js site?

    Hosting a blog on a subdomain can hurt SEO. Many experts recommend using a path like /blog on your main domain. Opinly serves posts under your domain, ensuring all SEO benefits go to your core site.