A static site generator, such as Astro or Hugo, is a tool that builds all the pages of a website in advance, so visitors get ready-made files. Instead of building a page every time a visitor arrives, the generator builds all pages once, and those files are what your host serves.
What is a static site generator?
The generator turns content and templates into plain files on your computer or in a build service, before the site is published.
You give the generator two things: templates that describe the layout, and content, such as text files, data or entries from a headless CMSA headless CMS is a system for editing content that has no website attached; a separate front end takes the content and builds the pages visitors see.. It combines them and writes out every page as HTML, together with stylesheets, scripts and images. When the work is done, the output is a folder that you can place on any web host or CDNA CDN is a network of servers around the world that keeps copies of your website close to your visitors, so pages load fast wherever they are..
Different generators suit different teams. Some are built around content-heavy sites with many pages and a simple structure, others around component-based design where pages mix static content with small interactive parts. The common idea stays the same: the heavy work happens at build time, not at visit time.
What it means for your PHP site
Your PHPPHP is a programming language that builds your web pages on the computer that hosts your site, just before they reach the visitor. WordPress runs on it. site does its assembly work on the live server, with PHP code and a database. A generator moves that to a build step, so the live server only hands out finished files. The result is a static websiteA static website is made of ready-made page files that the server hands over as they are, with no PHP code or database working behind the scenes. with no PHP and no database running when a page is shown. That means a smaller attack surfaceThe attack surface is the total of all places where an attacker could try to get in, such as logins, forms, plugins and the code on your server. and fewer parts that can fall behind on updates, though it does not make a site unhackable, since your hostingWeb hosting is the service that keeps your website's files on a computer that is always online, so visitors can open your site at any time. account, build pipeline and any third-party scripts still matter.
Your PHP versionA PHP version is a numbered edition of PHP, like 8.3. Each edition is looked after for a limited time, then gets security fixes only, then nothing. also stops being a concern for the public site, since nothing PHP runs there. The build tools have their own dependencies, and those need updating now and then, but on your computer or in a build service, not on the server facing visitors.
How to tell if it fits
A generator suits sites where the content is the same for every visitor and changes at a manageable pace: company sites, portfolios, blogs, documentation and landing pages. It suits teams who accept that a change goes through a build. It fits less well when the site must change many times per day or personalize every page.
Check the editing workflow before you decide. Ask who will update the site, how often, and whether they are comfortable with a headless CMS or a text-based approach. A good setup makes publishing a few clicks.
Replacing a WordPress site
The usual route is an inventory of existing pages, a rebuild of the design as templates, a content migration, a test on a stagingA staging environment is a private copy of your website where you try updates first, so any mistakes happen there and not on the live site. address and a switch of the domainA domain name is the address people type to reach your website, such as yourcompany.com. It points visitors to wherever your site is hosted. with redirects. The old WordPressWordPress is free software for building and editing a website in your browser. It is written in PHP, so it builds each page when someone visits. site can stay available during the test, so there is always a way back. Our WordPress to static site service does this work, and our PHP migration service covers a move to another host or stack.
Dynamic extras, such as a contact form or search, are added with small services or serverlessServerless is a way to run code without looking after your own server: the provider runs your small pieces of code when needed and keeps the machinery updated. functions.
When to act
Act when keeping a PHP site up to date costs more effort than the site is worth, when your PHP version is near the end of support, or when you are about to pay for a redesign anyway. A rebuild with a generator is a good moment to remove what you do not need.
Frequently asked questions
What is an example of a static site generator?
Astro and Hugo are well-known examples. Each takes your content and templates and produces a folder of HTML, CSS and JavaScript files that you upload to a host.
Do I need to code to use one?
The setup needs a developer. Day-to-day editing does not have to: content can live in a headless CMS or simple text files with an editing screen, so you can change text without touching code.
How does a new page go live?
You change the content, and the generator builds the site again. The new files are then uploaded, usually automatically from a code repository. It often takes a short while, rather than being instant like a live editor.
Can I move my WordPress content over?
Yes. Pages, posts and images can be exported and rebuilt as templates and content files. The design is recreated in the generator, and redirects keep your old URLs working.