Rewriting a React Site as a WordPress Theme: Two Ways to Build the Same XP
I built my XP-style personal site twice: first with React, then as a WordPress theme. The reason was not that React was bad; I needed an admin editor, members, comments, and URLs that could really be shared and indexed.
My personal site is a Windows XP. The first version was a React single-page app; the second became a WordPress theme. React was pleasant to develop until the site changed from a showcase into a personal site I needed to update constantly. Then content management, accounts, comments, and SEO became the real problems.
This was not a choice between “React good” and “WordPress good”. It was a choice of foundation for what the site actually needed.
React was a good fit for an interactive desktop
The first version was a static site built with Vite, React, TypeScript, and a state manager. Components made up the desktop, windows, and apps. Works, the résumé, and my profile lived in code, so changing content meant editing files, committing, building, and deploying.
That workflow was fast and predictable. But as the site grew, content no longer belonged in source code. I wanted to edit posts and images in an admin screen, and I wanted accounts, comments, and a URL for every piece of content.
The React version effectively had one URL, so sharing an article produced the homepage title, preview, and search result. Instead of adding an entire back end around React, I made WordPress the foundation and kept the XP desktop as the front end.
Keep the logic, rewrite the view
I did not want another Node build pipeline inside the theme, so the browser loads native ES modules. Most independent logic survived; the part I rewrote was the UI and the way it updates.
Without a bundler, cache invalidation becomes my responsibility. Bundlers add hashes to filenames; I add file modification versions to module URLs. Only the changed file gets a new URL. One ordering detail matters: the import map must come before modulepreload, or the browser resolves unversioned URLs first.
Give every piece of content its own URL
After the rewrite, works, posts, and major tools have their own paths. The visitor still sees one desktop, but opening a URL opens the matching window. Sharing the URL takes someone directly to that content.
The server outputs ordinary HTML for the requested page first, so search engines and people without JavaScript can read it. JavaScript then replaces it with the interactive desktop. These are two different views serving two different jobs.
Each URL also gets its own title, description, canonical URL, social metadata, and sitemap entry. A single-page React site can do all of this, but it has to build the content infrastructure itself.
Let WordPress handle content and accounts
Works became a custom post type, posts use WordPress’s content system, and other profile data lives in admin settings. Accounts, comments, previews, and revisions no longer need to be invented. Several functions that used to live in a Worker moved to WordPress APIs.
The desktop still needs its own state management. Native DOM does not re-render like React, so each view subscribes to the state it needs and cleans up its listeners when the window closes. It is closer to the browser, but easier to leak a listener.
The trade-off between the two approaches
React is fast for building interfaces, has type checking, and can run from a static host. WordPress makes content editable and provides a foundation for accounts, comments, previews, and content URLs.
The WordPress version also inherits work: canonical links, post routes, the admin toolbar, and other defaults need to be handled. Without a bundler, versioning and cache invalidation are my job. The Worker did not disappear; it shrank from a whole back end into a gatekeeper for the OpenAI key.
React is still a good choice for an interactive project. If a site has become a frequently updated content site, list the back-end features you actually need before deciding to migrate. If all you need is an editor, a headless CMS may be enough.
Web Development