A worked example
Consider a production WordPress site with 450 blog posts, 25 static landing pages, 60 category archives, and hundreds of media attachment pages. An equivalence audit reveals that 380 posts migrate directly to Next.js App Router dynamic routes (`/blog/[slug]/`), 40 outdated announcements should be retired with HTTP 410 Gone, and 30 thin articles should be consolidated into 5 comprehensive pillar guides via 301 redirects. Blindly redirecting all legacy URLs to the homepage would destroy historical keyword rankings and frustrate users.
A practical checklist
- Export and inventory all legacy WordPress URLs using Google Search Console, server access logs, and XML sitemaps to catalog every indexed route, page type, and organic traffic benchmark.
- Establish strict 1:1 URL mappings and equivalence criteria, preserving URL slugs wherever feasible or configuring permanent 301 redirects in next.config.ts for modified paths.
- Test redirect status codes, canonical metadata, JSON-LD schema parity, and responsive image performance in a staging environment before DNS cutover and post-launch Search Console validation.
1. Content inventory and equivalence audit
Begin by exporting a comprehensive list of all published WordPress posts, pages, custom post types, categories, and tags. Do not rely solely on the WordPress admin dashboard—cross-reference your export with Google Search Console coverage reports and server log files to catch legacy URLs that still receive search impressions or external backlinks. Categorize every legacy asset into one of four distinct migration actions: Migrate 1:1 (maintain exact topical scope), Consolidate (merge thin content into comprehensive guides with 301 redirects), Update (refresh facts, code, and date stamps), or Retire (remove obsolete promotions with an explicit HTTP 410 Gone header).
2. URL architecture, trailing slashes and 301 redirect rules
WordPress historically enforces trailing slashes on permalinks by default (e.g., `/blog/sample-post/`). In Next.js, decide on a consistent URL convention early. If preserving legacy WordPress rankings, configure trailingSlash: true in next.config.ts to prevent unnecessary 301 redirect hops from legacy bookmarks and external backlinks. When route paths must change, implement permanent 301 redirects rather than temporary 302 redirects. Never map discarded or low-value pages to the homepage—Google treats mass homepage redirects as soft 404s, eroding domain trust.
// next.config.ts - Production redirect configuration
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
trailingSlash: true,
skipTrailingSlashRedirect: true,
async redirects() {
return [
// 1:1 legacy URL migration
{
source: "/2024/05/12/legacy-slug/",
destination: "/blog/legacy-slug/",
permanent: true,
},
// Consolidated topic category to new pillar guide
{
source: "/category/wordpress-tips/",
destination: "/guides/wordpress-to-nextjs-migration/",
permanent: true,
},
];
},
};
export default nextConfig;3. WordPress to Next.js migration decision matrix
Use this operational worksheet to classify legacy WordPress assets and determine the correct Next.js technical response before initiating development:
| Legacy WordPress Asset | Equivalence Condition | Next.js Target Route | HTTP Response Code |
|---|---|---|---|
| High-traffic blog post | 1:1 topical equivalence; updated code and facts | /blog/[slug]/ (Static or Dynamic SSR) | 200 OK (Self-referencing canonical) |
| Thin or fragmented posts | Consolidated into single comprehensive guide | /guides/[new-pillar-slug]/ | 301 Moved Permanently |
| WordPress tag archives | High cannibalization; zero distinct organic value | Noindex during migration; remove from sitemap | 410 Gone or 301 to parent category |
| Obsolete event/promo | No equivalent content; expired commercial offer | Remove route completely from Next.js app | 410 Gone (signals permanent removal) |
| Attachment/media URLs | WordPress attachment pages (image.php) | Redirect to media file or parent article | 301 Moved Permanently to article |
4. Media, asset migration and image optimization
WordPress stores media in date-stamped directory trees under wp-content/uploads/. When migrating media to Next.js, store shared branding in the public/ folder or serve article imagery from an optimized asset store. Replace legacy raw <img> tags with Next.js next/image components to ensure automatic WebP/AVIF modern format conversion, responsive srcset generation, and explicit width/height dimensions that prevent Cumulative Layout Shift (CLS). For above-the-fold hero illustrations, supply priority or preload hints while keeping below-the-fold images lazy-loaded.
5. Metadata, canonical parity and JSON-LD structured data
WordPress SEO plugins (such as Yoast or Rank Math) store metadata in custom post meta tables. In Next.js App Router, implement the generateMetadata API to dynamically emit page-level <title>, <meta name="description">, OpenGraph tags, and canonical link elements. Verify that every page declares a clean, self-referencing canonical URL matching the exact preferred protocol, host, and trailing slash format. Additionally, embed server-rendered JSON-LD schema (Article or BlogPosting, and BreadcrumbList) directly into the HTML to maintain structured data continuity for Google Search and AI answer engines.
6. Pre-launch and post-cutover technical SEO checklist
Execute these critical operational checks before pointing production DNS to the new Next.js deployment:
- Validate that all 301 redirects respond with HTTP 301 and point directly to the final destination without intermediary redirect chains.
- Verify that robots.txt permits search crawler access to public content while disallowing internal administrative routes.
- Generate dynamic XML sitemaps (/sitemap.xml) listing only approved, indexable HTTP 200 URLs with accurate lastmod dates.
- Check that server-rendered HTML contains full article text and headings before client hydration runs.
- Submit the updated XML sitemap in Google Search Console immediately following DNS propagation.
- Monitor Google Search Console Coverage and Crawl Stats reports daily for 404 errors, redirect loops, or soft 404 anomalies.
What to avoid
Avoid wildcard-redirecting all legacy WordPress URLs to the homepage, which triggers soft 404 penalties. Do not deploy Next.js pages without self-referencing canonical URLs or forget to configure trailing slash consistency in next.config.ts. Avoid leaving legacy attachment pages or empty tag archives unhandled, and never launch without verifying that server-rendered HTML contains complete article copy before JavaScript execution.

