A dynamic website builds the page when someone asks for it. A static website is built in advance and sits ready as finished files. The difference decides how fast the site is, how much can break, who can edit it, and what it can do.
The choice is rarely either-or. Most WordPress sites are dynamic but send finished HTML files to most visitors, and many static sites have dynamic parts. Here we go through the differences, and when each approach makes sense. If you’re in the middle of a bigger choice of platform, read that guide as well.
The difference
On a dynamic website, the content lives in a database. When a visitor opens a page, the server runs a program, such as WordPress, that fetches the content, puts it into a template and sends the finished HTML. That happens on every request, unless a cache has stored the result. In return, the page can be different for each visitor: a cart, an account, a search result.
A static website is built once, whenever the content changes. A static site generator like Hugo, Eleventy or Astro takes texts and templates and produces a folder of HTML files, which is uploaded to a web server or a CDN. The server just sends the files. There’s no database and no code running when someone visits the site, and everyone gets the same page.
Side by side
| Dynamic (e.g. WordPress) | Static (e.g. Hugo, Astro) | |
|---|---|---|
| Speed | Depends on server, code and cache | Fast from the start |
| Features | Store, login, search and user content built in | Requires JavaScript and external services |
| Editing | In an editor in the browser, for everyone | In files or a headless CMS, often with a developer |
| Security | Core, plugins and theme have to be kept up to date | Very small attack surface |
| Operations | Server with PHP and a database, updates, backups | File hosting or a CDN, a build process |
| Cost | Hosting with PHP and a database, plus ongoing maintenance | File hosting is cheap or free; the development costs |
The table shows tendencies. What decides the choice is usually features and editing, not speed.
Speed
A static page is fast without anyone having to do anything: there’s nothing to calculate, and the files can sit on a CDN close to the visitor. A dynamic page has to be generated first, and how long that takes depends on the server, the database and the plugins.
The difference is smaller than it sounds. With a page cache, WordPress also sends finished HTML files to most visitors, and then the response time is close to a static page’s. The exception is the pages that can’t be cached because they’re different for each visitor, like the cart, checkout and my account. Those are the ones that have to be fast in themselves, and that’s the subject of our guide to WordPress performance.
Interactivity on a static site
Static doesn’t mean the site stands still. Forms, search, comments and even payment can be added with JavaScript and external services: a form service that sends the email, a search index built along with the site, or a payment link from a payment provider. The price is that every feature is a new service with its own terms, its own login and its own bill, and that it takes a developer to put them together. If there are many of them, a dynamic solution is often simpler.
Security and operations
A static site has almost nothing to attack. There’s no database to run SQL injection against, no login and no plugins with vulnerabilities. A WordPress site, on the other hand, has to be kept up to date: the core, plugins and theme get regular security fixes, and a site that isn’t maintained sooner or later becomes a target.
In return, the static site moves the work somewhere else. It’s built by a build process with its own dependencies that also need updating, and content is changed in files or through a headless CMS, which non-technical editors often find harder than the WordPress editor. So the real question is who will edit the site, and who will maintain it.
How to choose
Start with what the site has to do, and map out its pages and content before you choose the technology. If customers need to buy, log in, see their orders or write content, a dynamic solution is the natural choice, and for an online store it’s in practice the only one. A CMS like WordPress with WooCommerce gives you a cart, payment, inventory and customer accounts without having to assemble it from external services.
If the site is mainly content that gets read, like a company site, documentation or a campaign page, the choice is about who edits it. If it’s developers who work in code anyway, a static site is fast, secure and cheap to run. If it’s marketing or the owner who needs to fix a text on a Friday afternoon, WordPress with a good page cache is usually the better choice: you get an editor everyone can use, and a speed close to the static one.
In between sits headless: content is edited in a CMS, and the site is built as static files every time something changes. That gives static speed and a real editor, but also two systems to run, and a change only becomes visible once the site has been rebuilt. It makes sense for large content sites with a development team, rarely for a smaller business.
Frequently asked questions
Is WordPress a dynamic or a static website?
Dynamic. WordPress builds pages from the database when they’re requested. With a page cache, though, it behaves almost like a static site for most visitors.
Can an online store be static?
The product pages can, but the cart, payment, inventory and customer accounts need something dynamic, either your own server or an external store service. For most stores, a dynamic platform is simplest.
Is a static site better for SEO?
Not in itself. Google sees the finished HTML either way. Speed counts, but a dynamic site with a cache can be just as fast, and the content matters far more.
Want help choosing?
We build dynamic sites and online stores in WordPress and WooCommerce, and we’ll say so if a static site suits what you need better. Read more about WordPress and WooCommerce with us.