How to Host a Static JavaScript App on WordPress
Got a folder of HTML, CSS, and JavaScript — maybe a game, a tool, or an AI-generated app? Here's how to serve it at a URL on your WordPress site.
Not every app comes from a framework. Plenty are just a folder of HTML, CSS, and JavaScript — a canvas game, a little calculator, a WebGL demo, or something an AI tool generated for you. The good news: these are the easiest kind of app to put on WordPress, because there’s nothing to compile.
Step 1: Use relative paths
A static app works at any URL as long as its index.html links to assets relatively:
<link rel="stylesheet" href="style.css" />
<script src="app.js"></script>
<img src="images/logo.png" />
Avoid leading slashes (/style.css), which assume the app sits at the domain root and break when it’s
in a subfolder. Make sure index.html is at the top level of your folder, then zip the folder’s
contents.
Step 2: Publish it
The simplest method, and the one that works on shared hosting with no file access:
- Download App To Page, install it (Plugins → Add New → Upload Plugin), and activate it.
- Open App To Page → Apps.
- Drag your zip onto the dropzone, pick a URL like
/snake, and click Create draft. - Preview to play-test it privately, then Publish.
Your app is live at yoursite.com/snake, running standalone — no theme CSS or JavaScript interfering
with it. App To Page also serves the file types these apps use, with correct content types, including
wasm, fonts, audio, and 3D formats like glb, gltf, and stl.
Doing it by hand
You can also upload your folder via your host’s File Manager or FTP, put it on your own server, embed a small one in a page with a code snippet, or host it on Cloudflare Pages. Each is covered in How to add a web app to WordPress: 6 methods.
FAQ
My game loads but some assets 404 — why? Either an asset is referenced with an absolute path, or a file got left out of the zip. Use relative paths and make sure every asset is inside the folder you upload.
Can I host an HTML5 / canvas / WebGL game this way? Yes — that’s a perfect fit. It’s served as a standalone page, so nothing from your theme interferes.
Will it work with an app an AI tool built for me? Yes. Ask the AI to produce a production build with relative paths (we ship a deploy-ready prompt and agent skills for exactly this), then upload it.
Conclusion
A static JavaScript app is the simplest thing to put on WordPress: keep your paths relative, then publish it with App To Page — or follow the manual methods if you’d rather upload the files yourself.