How to Add a React App to WordPress (Without Rebuilding It)
You don't need to turn your React app into a WordPress theme or block. Build it, set one option, and serve it at a URL on your site — here's how.
A lot of tutorials tell you to rebuild your React app as a WordPress theme or a Gutenberg block. You don’t have to. If you already have a working React build, you can serve it as-is at a URL on your WordPress site. Here’s the clean way to do it.
Step 1: Build for a subfolder
React apps assume they’re served from the domain root unless you tell them otherwise, which breaks
asset links when the app lives at /my-app. Fix it before building:
Create React App — in package.json:
{ "homepage": "." }
Vite + React — in vite.config.js:
export default { base: './' };
Then build:
npm run build
Create React App outputs a build/ folder; Vite outputs dist/. Zip the contents of that
folder (so index.html is at the top of the archive).
Step 2: Handle React Router (deep links)
If you use React Router, a visitor who refreshes /my-app/dashboard needs the server to return
your index.html so the router can take over — otherwise they get a 404. The
App To Page method handles this automatically (it’s called SPA fallback, and it’s on by
default). With a manual upload you’ll add a server rule yourself — see the
full guide.
Step 3: Publish it
The fastest path that works on any host:
- Download App To Page, install it under Plugins → Add New → Upload Plugin, and activate it.
- Go to App To Page → Apps.
- Drag your
build/distzip onto the dropzone and pick a URL like/my-app. - Create draft → Preview → Publish.
Your React app is live at yoursite.com/my-app, rendered standalone with no theme styles bleeding in,
and deep links work out of the box.
Other ways to do it
You can also upload the build folder via File Manager, FTP, your own server, or Cloudflare Pages — all walked through in How to add a web app to WordPress: 6 methods.
FAQ
Do I have to convert my React app into a WordPress plugin or theme? No. That’s the slow path. Serve the build you already have.
Will the WordPress theme’s CSS interfere with my app? Not with App To Page — your app is served standalone at its own URL, outside the theme. (If you embed an app inside a page with a code snippet instead, isolate it in an iframe to avoid collisions.)
Does this work for Next.js?
For a fully static export (next export / output: 'export'), yes — treat the exported folder like
any other static build. Apps that need a Node server at runtime are a different setup.
Conclusion
Adding a React app to WordPress doesn’t mean rewriting it. Build with a relative base, then publish it with App To Page — or follow the manual methods if you prefer.