Skip to content
    2025-07-01|5 min read

    Why I Migrated from WordPress to Next.js

    #nextjs#wordpress#migration#seo#react

    WordPress powers over 40% of the web. It's battle-tested, has a massive ecosystem, and anyone can publish content with it. So why would a developer migrate away?

    Last year, I migrated my portfolio and client sites from WordPress to Next.js. This is the honest story of why I did it, what I gained, what I lost, and exactly how I handled the migration — including the SEO preservation strategy that kept rankings intact. I used the same approach for CanvasInc, a luxury interior design studio that moved from WordPress to a custom Next.js platform.

    Why WordPress No Longer Fit

    WordPress served me well for years. But three specific pain points drove the decision.

    Performance Ceiling

    Even with caching plugins (W3 Total Cache, WP Rocket), a CDN, and optimized hosting on Kinsta, my Lighthouse scores hovered around 65–75 on mobile. The fundamental issue is that WordPress renders pages server-side with PHP on every uncached request, and the enormous CSS/JS payload from plugins adds unavoidable bloat.

    No amount of optimization could match the performance profile of a static Next.js site.

    The Maintenance Tax

    Security updates, plugin conflicts, database bloat, comment spam — every month brought a new maintenance task. I spent more time maintaining WordPress than writing actual content.

    The Developer Experience Gap

    Working with WordPress as a developer means building custom Gutenberg blocks, navigating the REST API, or wrestling with Advanced Custom Fields. The development workflow — local environment, version control, deployment pipeline — is a constant fight against WordPress's architecture.

    Next.js, by contrast, feels purpose-built for how modern developers want to work.

    The Migration: Step by Step

    Step 1: Content Audit

    I exported all posts and pages from WordPress using the native export tool (XML format). I then converted this to Markdown using wordpress-export-to-markdown:

    ``bash npx wordpress-export-to-markdown \ --input export.xml \ --output content/blog \ --year-folders false ``

    This produced clean Markdown files with frontmatter. I manually reviewed each one for formatting issues and converted any remaining Gutenberg blocks.

    Step 2: Setting Up Next.js

    I chose Next.js with next-mdx-remote for blog content:

    ```typescript import { serialize } from 'next-mdx-remote/serialize'; import { MDXRemote } from 'next-mdx-remote';

    export async function getStaticProps() { const source = fs.readFileSync(content/blog/${slug}.mdx, 'utf-8'); const mdxSource = await serialize(source, { mdxOptions: { remarkPlugins: [remarkGfm], rehypePlugins: [rehypeHighlight] }, }); return { props: { source: mdxSource } }; } ```

    Step 3: Redesigning the Editor Workflow

    This was the hardest part. Clients used to logging into WordPress, clicking "Add New Post," and using the visual editor needed a new workflow.

    My solution: Decap CMS (formerly Netlify CMS) integrated with Next.js. Clients get a visual editor that commits Markdown directly to the GitHub repository:

    ```yaml

    public/admin/config.yml

    backend: name: github repo: username/portfolio-site branch: main

    media_folder: public/images public_folder: /images

    collections:

    - name: blog label: Blog Posts folder: content/blog format: frontmatter fields:

    - { name: title, label: Title }

    - { name: date, label: Date, widget: datetime }

    - { name: body, label: Body, widget: markdown } ```

    Step 4: SEO Preservation Strategy

    Preserving search rankings was non-negotiable. Here's what I did:

    Mapped every old URL to its new equivalent:

    Old WordPress URLNew Next.js URL
    /blog/?p=123/blog/my-post-slug
    /category/dev/blog?category=dev
    /about-me/about

    Implemented 301 redirects in next.config.js:

    ``javascript // next.config.js module.exports = { async redirects() { return [ { source: '/blog/:year/:month/:slug', destination: '/blog/:slug', permanent: true, }, { source: '/category/:category', destination: '/blog?category=:category', permanent: true, }, ]; }, }; ``

    Preserved all metadata: Every page retained its original title tag, meta description, and Open Graph tags. I used next/head to inject metadata dynamically:

    ```tsx import Head from 'next/head';

    export default function BlogPost({ post }) { return ( <Head> <title>{post.seoTitle}</title> <meta name="description" content={post.metaDescription} /> <meta property="og:title" content={post.ogTitle} /> <meta property="og:image" content={post.coverImage} /> <link rel="canonical" href={https://www.rahulsinghnegi.com/blog/${post.slug}} /> </Head> ); } ```

    Submitted the new sitemap to Google Search Console and monitored for crawl errors and ranking changes over 30 days.

    The Results

    Performance:

    • Lighthouse mobile score: 65 → 97
    • Page load time: 4.2s → 0.8s
    • Total page weight: 2.3MB → 180KB

    SEO:

    • Rankings for primary keywords: +15% after 2 months
    • Organic traffic: recovered within 3 weeks, growing afterward
    • Zero errors in Google Search Console post-migration

    Maintenance:

    • Zero security updates to apply
    • Zero plugin conflicts
    • Deployment is a single git push

    What I Lost

    Not everything was a win. I lost access to the WordPress plugin ecosystem — no more Yoast SEO, Akismet spam filtering, or WooCommerce. Comments required a third-party solution (I use Giscus). Clients accustomed to the WordPress admin took time to adjust.

    Conclusion

    The migration from WordPress to Next.js was the right decision for my use case. The performance gains alone justified the effort, but the improved developer experience and near-zero maintenance have been equally transformative. If you're a developer managing your own or client sites with WordPress, seriously consider whether the legacy overhead is worth the convenience.

    Thinking about migrating your WordPress site? Let's discuss your project — I'll provide a detailed migration plan with an SEO preservation strategy.

    ---

    R

    Written by

    Rahul

    Freelance developer for startups building SaaS products, MVPs, mobile apps, and conversion-focused website improvements.

    Building something?

    I am currently available for new projects. Share your idea and I will give you an honest assessment, delivery plan, and quote.