To get a WordPress blog into JSON for React or Next.js, start with the tool WordPress already gives you: the REST API. Request /wp-json/wp/v2/posts and every post comes back as JSON, with title, content, slug, date, and more, ready to render in a React front end. For a full archive you page through the endpoint or export to clean JSON files. The detail that protects your traffic is keeping the slugs and metadata, so URLs and SEO survive the move. WPBuildAI extracts the whole blog as clean JSON with slugs and metadata intact, ready for a React build.

Pin the version you are exporting from, because WordPress moved fast in 2026: 7.0 “Armstrong” landed on 20 May 2026, followed by 7.0.1 and a 7.0.2 security release in July, and REST output can shift between releases in ways a hard-coded scraper will not forgive.

API first, scraping as a fallback

“Scrape” is the word people reach for, but on WordPress you rarely need to scrape, because the content is already available as structured data. The REST API is the clean path: it returns each post with named fields, documented in the WordPress REST API Handbook, so you get title, content, excerpt, slug, date, author, and categories as JSON rather than tangled in theme markup. Genuine scraping, parsing the rendered HTML back into data, should be the fallback, used only when the API is disabled, because the 2024 Web Almanac shows how much of a rendered page is markup rather than content, so reconstructing data from HTML is lossy and error-prone. The principle is to take the structured data WordPress already exposes, and only fall back to reading rendered pages when you have no API access. Either way the goal is clean JSON, not raw HTML.

What the posts endpoint returns

Knowing what the endpoint gives you tells you what you can build from. /wp-json/wp/v2/posts returns an array of post objects, each carrying an id, the slug, the title, the content (as rendered HTML), the excerpt, the publish and modified dates, the author id, and the category and tag ids, among other fields. Related endpoints expose pages, media, categories, and tags, so the whole blog’s data is reachable through the same API. The content field is HTML, which matters: it is the post body as WordPress renders it, so you will either render that HTML in React or convert it to a cleaner form. The ids let you resolve relationships, an author id to an author, category ids to category names, by following the related endpoints. Understanding this shape means you can request exactly the fields you need and assemble a complete picture of each post, rather than discovering a missing field after you have built the front end.

Paging through the whole archive

The one thing that trips people up is that the API paginates: a single request returns a page of posts (commonly up to 100), not the entire archive. So pulling a 400-post blog means requesting page 1, then page 2, and so on, until you have them all, using the per-page and page parameters and reading the total-pages header the API returns. Skip this and you quietly capture only the first hundred posts, leaving three-quarters of the blog behind, a gap that is easy to miss because the export looks like it worked. For very large blogs, page through in batches and assemble the full set of JSON files. The completeness rule is the same as any migration: you want every post, not the first page, so honour the pagination and verify the count against your known post total before building anything on top of the export.

A worked example: 400 posts into Next.js

Picture moving a 400-post blog to Next.js. You page through /wp-json/wp/v2/posts in batches of 100, four requests, assembling 400 post objects, each with its slug, title, content, date, and category ids. You resolve the category ids against the categories endpoint so each post carries readable category names, and you note the image URLs in each post’s content for re-hosting. In Next.js, you generate a static or server-rendered page per post, keyed by the original slug so the URLs match the old blog, and a blog index and category pages from the same data. Internal links and images are re-pointed to the new paths. The result is a fast Next.js blog at the same URLs, built entirely from the API export, with all 400 posts present because you paged through completely. The API gave the data; honouring pagination gave completeness; keeping slugs preserved the URLs.

Keep the SEO when you move to React

A React or Next.js blog can rank perfectly well, but only if you avoid two specific mistakes. First, render the content server-side. If the front end fetches posts in the browser and renders them client-side, a crawler that does not run JavaScript sees an empty page, the failure Google describes in its JavaScript SEO basics; Next.js supports static generation and server rendering precisely so the HTML is complete on first load. Second, keep the slugs so URLs barely change, and 301 anything that does, preserving the titles and structure that Backlinko’s analysis of 11.8 million search results found correlate with ranking. Carry each post’s title and meta description from the data into the rendered head. Get these two right, server render and stable slugs, and the move to React is an upgrade; get either wrong and a fast-looking blog loses its rankings. This is the blog-specific version of the work in making WordPress headless and connecting an AI builder to the REST API.

The JSON references images and internal links by URL, and both need handling or they break. The post content’s HTML points at images in the WordPress media library, so re-host those images on the new front end (or a CDN) and update the references, or they vanish when WordPress is retired. Internal links between posts point at old WordPress URLs, so rewrite them to the new paths, which is easy if you kept the slugs because the paths mostly match. The navigation menu is separate again: it does not come through the posts endpoint, so extract it on its own, as covered in extracting WordPress menus into Next.js JSON. Handling media, internal links, and menus as their own steps is what leaves the React build free of broken images, dead links, and missing navigation. If a static target suits you better than React, the same exported data feeds a WordPress blog to Astro.

Rendered HTML in content: clean or convert

One decision shapes how maintainable the React blog is: what to do with the content field, which arrives as WordPress’s rendered HTML. You can render that HTML directly in React, which is quickest but carries over any theme-specific markup and shortcode residue baked into the content. Or you can convert it to clean Markdown or a structured format during the export, which gives you cleaner, more portable content at the cost of a conversion step. For a blog you intend to maintain in the new stack, converting to clean Markdown is usually worth it, because you are no longer carrying WordPress’s markup quirks forward. For a quick lift-and-shift, rendering the HTML as-is may be acceptable. Either way, watch for shortcodes in the content that will not render outside WordPress, those need resolving or removing. Deciding this deliberately, rather than blindly dumping rendered HTML into React, is what determines whether the new blog is clean to work with or carries the old site’s baggage.

Common mistakes getting a blog into JSON

The recurring errors are avoidable. Capturing only the first API page leaves most of the archive behind, because the endpoint paginates. Rendering content client-side hides the blog from crawlers. Letting the new system generate fresh slugs changes every URL and forces a full redirect map where keeping slugs would have avoided it. Leaving images referenced on the old WordPress domain breaks them when it is retired. Forgetting the menu, which is not in the posts endpoint, ships a blog with no navigation. And dumping raw rendered HTML with unresolved shortcodes into React carries the old markup baggage forward. Each is avoided by paging through the full archive, server-rendering, keeping slugs, re-hosting media, extracting the menu separately, and deciding deliberately how to handle the content HTML, which turns the API export into a clean, complete, rank-safe React blog.

Key points to remember

Get a WordPress blog into JSON for React or Next.js through the REST API at /wp-json/wp/v2/posts, which returns structured post data, rather than scraping HTML, which is the lossy fallback for when the API is off. Page through the whole archive so you capture every post, not just the first hundred, and resolve related data like categories. Keep the SEO by server-rendering the content so crawlers see it and keeping the slugs so URLs barely change, carrying titles and descriptions into the head and 301ing anything that moves. Re-host images, rewrite internal links, extract the menu separately, and decide whether to render the content HTML as-is or convert it to clean Markdown. WPBuildAI exports the blog as clean JSON, re-hosts media, and rewrites links, so the React build keeps its URLs and rankings; send your site URL for a fixed quote.

Not affiliated with WordPress, Next.js, or Lovable.