[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-en-nextjs-vs-wordpress-2025":3},{"id":4,"title":5,"author":6,"body":7,"cover":862,"description":863,"draft":864,"extension":865,"locale":866,"meta":867,"navigation":334,"path":868,"publishedAt":869,"seo":870,"seoTitle":871,"slug":872,"stem":873,"tags":874,"__hash__":880},"blog\u002Fen\u002Fblog\u002Fnextjs-vs-wordpress-2025.md","Next.js vs WordPress in 2025: a decision tree and the headless path","Manuel Tardivo",{"type":8,"value":9,"toc":850},"minimark",[10,26,44,50,75,80,85,113,117,139,143,166,170,185,189,250,254,272,283,685,690,715,719,722,802,806,832,846],[11,12,13,17,18,21,22,25],"p",{},[14,15,16],"strong",{},"Problem you solve:"," you need to decide ",[14,19,20],{},"where the CMS lives"," and ",[14,23,24],{},"where the frontend lives"," without star-rating tables or slogans.",[11,27,28,31,32,35,36,39,40,43],{},[14,29,30],{},"What you get from this article:"," a ",[14,33,34],{},"binary decision tree"," and, if the hybrid wins, a ",[14,37,38],{},"concrete snippet"," to read posts from WordPress in Next.js (App Router) via the ",[14,41,42],{},"REST API",".",[11,45,46,49],{},[14,47,48],{},"How you know the choice is coherent:"," each branch ends with a checkable constraint (team, editorial budget, hosting).",[51,52,53],"blockquote",{},[11,54,55,58,59,62,63,67,68,71,72,43],{},[14,56,57],{},"Note:"," “Next.js” here means “React app with SSR\u002FSSG”; the same REST pattern applies to ",[14,60,61],{},"Nuxt"," with ",[64,65,66],"code",{},"useFetch"," \u002F ",[64,69,70],{},"$fetch"," against ",[64,73,74],{},"wp-json",[76,77,79],"h2",{"id":78},"decision-tree-answer-in-order","Decision tree (answer in order)",[81,82,84],"h3",{"id":83},"_1-who-updates-content-weekly","1. Who updates content weekly?",[86,87,88,103],"ul",{},[89,90,91,94,95,98,99,102],"li",{},[14,92,93],{},"Mostly non-technical editors"," wanting WYSIWYG + plugins → favour ",[14,96,97],{},"classic WordPress"," (monolith) or ",[14,100,101],{},"headless WP"," if the UI must be custom.",[89,104,105,108,109,112],{},[14,106,107],{},"Developers only"," (Markdown, Git, PR review) → you often ",[14,110,111],{},"do not need WordPress",": SSG, Nuxt Content, etc. reduce surface area.",[81,114,116],{"id":115},"_2-do-you-need-user-login-cart-dashboards-or-complex-app-logic-in-the-frontend","2. Do you need user login, cart, dashboards, or complex app logic in the frontend?",[86,118,119,129],{},[89,120,121,124,125,128],{},[14,122,123],{},"Yes"," → ",[14,126,127],{},"Next.js (or Nuxt)"," as the app; WordPress at most as a headless CMS, not “theme + 30 plugins”.",[89,130,131,134,135,138],{},[14,132,133],{},"No",", it is a brochure\u002Fblog → ",[14,136,137],{},"WordPress monolith"," can be enough if hosting + theme are disciplined.",[81,140,142],{"id":141},"_3-is-the-main-constraint-time-to-market-on-a-tight-budget","3. Is the main constraint time-to-market on a tight budget?",[86,144,145,153],{},[89,146,147,124,149,152],{},[14,148,123],{},[14,150,151],{},"WordPress + solid theme + few plugins"," usually beats a pure custom marketing MVP.",[89,154,155,157,158,161,162,165],{},[14,156,133],{},", the constraint is ",[14,159,160],{},"LCP\u002FINP"," on a critical funnel and full markup control → ",[14,163,164],{},"custom frontend"," (Next\u002FNuxt) + headless CMS or repo-based content.",[81,167,169],{"id":168},"_4-must-you-integrate-internal-apis-feature-flags-server-side-ab-multi-tenant","4. Must you integrate internal APIs, feature flags, server-side A\u002FB, multi-tenant?",[86,171,172,180],{},[89,173,174,124,176,179],{},[14,175,123],{},[14,177,178],{},"Next.js\u002FNuxt"," (or another app framework); WordPress monolith becomes friction.",[89,181,182,184],{},[14,183,133],{}," → stay on monolith until you measure a real bottleneck.",[76,186,188],{"id":187},"three-likely-outcomes","Three likely outcomes",[190,191,192,208],"table",{},[193,194,195],"thead",{},[196,197,198,202,205],"tr",{},[199,200,201],"th",{},"Outcome",[199,203,204],{},"When",[199,206,207],{},"Risks to manage",[209,210,211,224,237],"tbody",{},[196,212,213,218,221],{},[214,215,216],"td",{},[14,217,137],{},[214,219,220],{},"Frequent content, editorial team, mostly static site",[214,222,223],{},"Performance (theme\u002Fplugins), core updates, security",[196,225,226,231,234],{},[214,227,228],{},[14,229,230],{},"Next.js \u002F Nuxt without WP",[214,232,233],{},"Content in Git or a headless SaaS (Sanity, Contentful, …)",[214,235,236],{},"Non-technical editor UX",[196,238,239,244,247],{},[214,240,241],{},[14,242,243],{},"Headless WordPress",[214,245,246],{},"Editors want WP, frontend wants controlled React\u002FVue",[214,248,249],{},"Two deploys, caching, REST\u002FGraphQL auth, hosting cost",[76,251,253],{"id":252},"headless-wordpress-nextjs-minimal-pattern","Headless WordPress + Next.js: minimal pattern",[11,255,256,257,259,260,263,264,271],{},"WordPress exposes the ",[14,258,42],{}," at ",[64,261,262],{},"\u002Fwp-json\u002F"," (see ",[265,266,270],"a",{"href":267,"rel":268},"https:\u002F\u002Fdeveloper.wordpress.org\u002Frest-api\u002F",[269],"nofollow","REST API Handbook",").",[11,273,274,275,278,279,282],{},"Example ",[14,276,277],{},"Server Component"," (App Router) fetching latest posts (sanitize HTML before rendering ",[64,280,281],{},"content.rendered"," in production):",[284,285,290],"pre",{"className":286,"code":287,"language":288,"meta":289,"style":289},"language-typescript shiki shiki-themes github-light github-dark","\u002F\u002F app\u002Fblog\u002Fpage.tsx — set WP_URL in .env\nconst WP = process.env.WP_URL ?? 'https:\u002F\u002Fexample.com'\n\ntype WpPost = { id: number; slug: string; title: { rendered: string } }\n\nexport default async function BlogIndex() {\n  const res = await fetch(`${WP}\u002Fwp-json\u002Fwp\u002Fv2\u002Fposts?per_page=5&_fields=id,slug,title`, {\n    next: { revalidate: 60 },\n  })\n  if (!res.ok) throw new Error(`WP ${res.status}`)\n  const posts = (await res.json()) as WpPost[]\n  return (\n    \u003Cul>\n      {posts.map((p) => (\n        \u003Cli key={p.id}>\n          \u003Ca href={`\u002Fblog\u002F${p.slug}`}>{p.title.rendered}\u003C\u002Fa>\n        \u003C\u002Fli>\n      ))}\n    \u003C\u002Ful>\n  )\n}\n","typescript","",[64,291,292,301,329,336,391,396,417,449,461,467,510,542,551,562,589,606,647,657,663,673,679],{"__ignoreMap":289},[293,294,297],"span",{"class":295,"line":296},"line",1,[293,298,300],{"class":299},"sJ8bj","\u002F\u002F app\u002Fblog\u002Fpage.tsx — set WP_URL in .env\n",[293,302,304,308,312,315,319,322,325],{"class":295,"line":303},2,[293,305,307],{"class":306},"szBVR","const",[293,309,311],{"class":310},"sj4cs"," WP",[293,313,314],{"class":306}," =",[293,316,318],{"class":317},"sVt8B"," process.env.",[293,320,321],{"class":310},"WP_URL",[293,323,324],{"class":306}," ??",[293,326,328],{"class":327},"sZZnC"," 'https:\u002F\u002Fexample.com'\n",[293,330,332],{"class":295,"line":331},3,[293,333,335],{"emptyLinePlaceholder":334},true,"\n",[293,337,339,342,346,348,351,355,358,361,364,367,369,372,374,377,379,381,384,386,388],{"class":295,"line":338},4,[293,340,341],{"class":306},"type",[293,343,345],{"class":344},"sScJk"," WpPost",[293,347,314],{"class":306},[293,349,350],{"class":317}," { ",[293,352,354],{"class":353},"s4XuR","id",[293,356,357],{"class":306},":",[293,359,360],{"class":310}," number",[293,362,363],{"class":317},"; ",[293,365,366],{"class":353},"slug",[293,368,357],{"class":306},[293,370,371],{"class":310}," string",[293,373,363],{"class":317},[293,375,376],{"class":353},"title",[293,378,357],{"class":306},[293,380,350],{"class":317},[293,382,383],{"class":353},"rendered",[293,385,357],{"class":306},[293,387,371],{"class":310},[293,389,390],{"class":317}," } }\n",[293,392,394],{"class":295,"line":393},5,[293,395,335],{"emptyLinePlaceholder":334},[293,397,399,402,405,408,411,414],{"class":295,"line":398},6,[293,400,401],{"class":306},"export",[293,403,404],{"class":306}," default",[293,406,407],{"class":306}," async",[293,409,410],{"class":306}," function",[293,412,413],{"class":344}," BlogIndex",[293,415,416],{"class":317},"() {\n",[293,418,420,423,426,428,431,434,437,440,443,446],{"class":295,"line":419},7,[293,421,422],{"class":306},"  const",[293,424,425],{"class":310}," res",[293,427,314],{"class":306},[293,429,430],{"class":306}," await",[293,432,433],{"class":344}," fetch",[293,435,436],{"class":317},"(",[293,438,439],{"class":327},"`${",[293,441,442],{"class":310},"WP",[293,444,445],{"class":327},"}\u002Fwp-json\u002Fwp\u002Fv2\u002Fposts?per_page=5&_fields=id,slug,title`",[293,447,448],{"class":317},", {\n",[293,450,452,455,458],{"class":295,"line":451},8,[293,453,454],{"class":317},"    next: { revalidate: ",[293,456,457],{"class":310},"60",[293,459,460],{"class":317}," },\n",[293,462,464],{"class":295,"line":463},9,[293,465,466],{"class":317},"  })\n",[293,468,470,473,476,479,482,485,488,491,493,496,499,501,504,507],{"class":295,"line":469},10,[293,471,472],{"class":306},"  if",[293,474,475],{"class":317}," (",[293,477,478],{"class":306},"!",[293,480,481],{"class":317},"res.ok) ",[293,483,484],{"class":306},"throw",[293,486,487],{"class":306}," new",[293,489,490],{"class":344}," Error",[293,492,436],{"class":317},[293,494,495],{"class":327},"`WP ${",[293,497,498],{"class":317},"res",[293,500,43],{"class":327},[293,502,503],{"class":317},"status",[293,505,506],{"class":327},"}`",[293,508,509],{"class":317},")\n",[293,511,513,515,518,520,522,525,528,531,534,537,539],{"class":295,"line":512},11,[293,514,422],{"class":306},[293,516,517],{"class":310}," posts",[293,519,314],{"class":306},[293,521,475],{"class":317},[293,523,524],{"class":306},"await",[293,526,527],{"class":317}," res.",[293,529,530],{"class":344},"json",[293,532,533],{"class":317},"()) ",[293,535,536],{"class":306},"as",[293,538,345],{"class":344},[293,540,541],{"class":317},"[]\n",[293,543,545,548],{"class":295,"line":544},12,[293,546,547],{"class":306},"  return",[293,549,550],{"class":317}," (\n",[293,552,554,557,559],{"class":295,"line":553},13,[293,555,556],{"class":317},"    \u003C",[293,558,86],{"class":344},[293,560,561],{"class":317},">\n",[293,563,565,568,571,573,576,579,581,584,587],{"class":295,"line":564},14,[293,566,567],{"class":317},"      {",[293,569,570],{"class":353},"posts",[293,572,43],{"class":317},[293,574,575],{"class":353},"map",[293,577,578],{"class":317},"((",[293,580,11],{"class":353},[293,582,583],{"class":317},") ",[293,585,586],{"class":306},"=>",[293,588,550],{"class":317},[293,590,592,595,598,601,604],{"class":295,"line":591},15,[293,593,594],{"class":306},"        \u003C",[293,596,597],{"class":317},"li key",[293,599,600],{"class":306},"=",[293,602,603],{"class":317},"{p.id}",[293,605,561],{"class":306},[293,607,609,612,615,617,620,623,625,627,629,631,634,637,640,643,645],{"class":295,"line":608},16,[293,610,611],{"class":306},"          \u003C",[293,613,614],{"class":317},"a href",[293,616,600],{"class":306},[293,618,619],{"class":317},"{",[293,621,622],{"class":327},"`\u002Fblog\u002F${",[293,624,11],{"class":317},[293,626,43],{"class":327},[293,628,366],{"class":317},[293,630,506],{"class":327},[293,632,633],{"class":317},"}",[293,635,636],{"class":306},">",[293,638,639],{"class":317},"{p.title.rendered}",[293,641,642],{"class":306},"\u003C\u002F",[293,644,265],{"class":317},[293,646,561],{"class":306},[293,648,650,653,655],{"class":295,"line":649},17,[293,651,652],{"class":306},"        \u003C\u002F",[293,654,89],{"class":317},[293,656,561],{"class":306},[293,658,660],{"class":295,"line":659},18,[293,661,662],{"class":317},"      ))}\n",[293,664,666,669,671],{"class":295,"line":665},19,[293,667,668],{"class":306},"    \u003C\u002F",[293,670,86],{"class":317},[293,672,561],{"class":306},[293,674,676],{"class":295,"line":675},20,[293,677,678],{"class":317},"  )\n",[293,680,682],{"class":295,"line":681},21,[293,683,684],{"class":317},"}\n",[11,686,687],{},[14,688,689],{},"Headless checklist:",[86,691,692,703,709],{},[89,693,694,695,698,699,702],{},"Canonical URLs and ",[14,696,697],{},"CORS"," if the browser calls WP directly (prefer ",[14,700,701],{},"server-to-server"," as above).",[89,704,705,708],{},[14,706,707],{},"Auth"," for draft previews: Application Passwords or a JWT plugin — never ship admin creds to the client.",[89,710,711,714],{},[14,712,713],{},"ISR \u002F revalidate"," in Next or Nuxt route rules so you do not hammer WP on every request.",[76,716,718],{"id":717},"nuxt-3-analogue","Nuxt 3 analogue",[11,720,721],{},"Same fetch on the server:",[284,723,725],{"className":286,"code":724,"language":288,"meta":289,"style":289},"const WP = useRuntimeConfig().public.wpUrl as string\nconst { data: posts } = await useFetch(`${WP}\u002Fwp-json\u002Fwp\u002Fv2\u002Fposts`, {\n  query: { per_page: 5, _fields: 'id,slug,title' },\n})\n",[64,726,727,746,781,797],{"__ignoreMap":289},[293,728,729,731,733,735,738,741,743],{"class":295,"line":296},[293,730,307],{"class":306},[293,732,311],{"class":310},[293,734,314],{"class":306},[293,736,737],{"class":344}," useRuntimeConfig",[293,739,740],{"class":317},"().public.wpUrl ",[293,742,536],{"class":306},[293,744,745],{"class":310}," string\n",[293,747,748,750,752,755,758,760,763,765,767,770,772,774,776,779],{"class":295,"line":303},[293,749,307],{"class":306},[293,751,350],{"class":317},[293,753,754],{"class":353},"data",[293,756,757],{"class":317},": ",[293,759,570],{"class":310},[293,761,762],{"class":317}," } ",[293,764,600],{"class":306},[293,766,430],{"class":306},[293,768,769],{"class":344}," useFetch",[293,771,436],{"class":317},[293,773,439],{"class":327},[293,775,442],{"class":310},[293,777,778],{"class":327},"}\u002Fwp-json\u002Fwp\u002Fv2\u002Fposts`",[293,780,448],{"class":317},[293,782,783,786,789,792,795],{"class":295,"line":331},[293,784,785],{"class":317},"  query: { per_page: ",[293,787,788],{"class":310},"5",[293,790,791],{"class":317},", _fields: ",[293,793,794],{"class":327},"'id,slug,title'",[293,796,460],{"class":317},[293,798,799],{"class":295,"line":338},[293,800,801],{"class":317},"})\n",[76,803,805],{"id":804},"summary","Summary",[807,808,809,816,821],"ol",{},[89,810,811,812,815],{},"Do ",[14,813,814],{},"not"," pick Next.js “because it is modern” if the team cannot maintain it.",[89,817,811,818,820],{},[14,819,814],{}," use WordPress as an app framework if business logic belongs in the frontend.",[89,822,823,824,827,828,831],{},"If you need ",[14,825,826],{},"WP editors + a controlled frontend",", ",[14,829,830],{},"headless"," is the clean third way — the code above is a feasibility spike in under an hour.",[11,833,834,835,827,838,841,842,845],{},"Final check: can you name ",[14,836,837],{},"who deploys WP",[14,839,840],{},"who deploys the frontend",", and ",[14,843,844],{},"where HTML is cached","? If both sides are clear, the stack is defined.",[847,848,849],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":289,"searchDepth":303,"depth":303,"links":851},[852,858,859,860,861],{"id":78,"depth":303,"text":79,"children":853},[854,855,856,857],{"id":83,"depth":331,"text":84},{"id":115,"depth":331,"text":116},{"id":141,"depth":331,"text":142},{"id":168,"depth":331,"text":169},{"id":187,"depth":303,"text":188},{"id":252,"depth":303,"text":253},{"id":717,"depth":303,"text":718},{"id":804,"depth":303,"text":805},"\u002Fblog\u002F29_nextjs_vs_wordpress_2025_1x.webp","Binary questions to pick a stack: WordPress monolith, a React app on Next.js, or headless WordPress. Includes a WP REST API fetch example.",false,"md","en",{},"\u002Fen\u002Fblog\u002Fnextjs-vs-wordpress-2025","2026-01-24",{"title":5,"description":863},"Next.js vs WordPress 2025: decision tree","nextjs-vs-wordpress-2025","en\u002Fblog\u002Fnextjs-vs-wordpress-2025",[875,876,877,878,879],"Next.js","WordPress","CMS","performance","sviluppo web","LY3B2VvCkEu5-ykvpjGOeBZOQja9-u0uY3V7v6zbuWM"]