Most of what I write about on this blog is newer tooling: Payload, Medusa, FastAPI. But I started with WordPress, and I still build WordPress sites when they fit the job. This post covers when that is, how I build them so they last, and how I moved my own site off WordPress when my needs changed.
When WordPress is the right choice
WordPress powers a large share of the internet, and there are good reasons for that. Most people have used it before. There's hosting for it everywhere, and the plugin ecosystem is huge. For content-heavy sites without custom application logic, it's hard to beat on time to launch.
I usually choose WordPress when:
- The client already knows WordPress, or has a team that does. That counts for more than you'd think. A system the editors are comfortable with gets used.
- The site is mostly content. Pages, products, cases and news that need to be maintained without a developer.
- There's a well-tested plugin for something that would otherwise be built from scratch, such as forms, multilingual support or a newsletter integration.
- The budget fits a known platform better than a custom stack, both for development and for running it.
I rule it out when the site has to be tightly coupled to an app or a webshop with unusual flows, when two languages need to be part of the content model itself, or when the client wants the content model versioned as code from day one. In those cases I usually point to React and Payload instead.
How I build a WordPress site
The biggest difference between a WordPress site that lasts for years and one that becomes hard to touch is the structure behind it. I build custom themes from scratch instead of using page builders. It takes a bit more work up front, but you get a site where the code is readable and the editor can't accidentally break the layout.
Custom post types for the things that differ
The first step is working out which types of content the site actually has. On my own old WordPress site there were four:
- Cases with their own archive and two taxonomies: a hierarchical category and a case type.
- Packages with their own archive and access through the WordPress REST API.
- Services with their own category taxonomy.
- Partners for the logo wall on the front page.
When each type has its own fields and templates, the content becomes predictable. A case is a case, and it looks the same everywhere. The alternative, where everything is a "page" with random blocks, works fine at first but gets messy as soon as there are twenty cases, each built slightly differently.
Fields with ACF, versioned in git
For fields I use Advanced Custom Fields. The important part is that the field groups don't live only in the database. The theme has an acf-json folder, and two hooks (acf/settings/save_json and acf/settings/load_json) make ACF both save and load the field definitions from there. That puts the fields in git next to the templates, changes can be reviewed, and a new environment gets the same fields automatically.
A case, for example, had fields for:
- Whether the case is featured, the client logo, completion date, industry, platform and scope.
- A short intro and a list of key figures.
- Problem, solution and result as three separate text fields.
- A gallery and a testimonial with text, name and role.
Packages had duration, price, a list of benefits and tags. Partners had a logo and a link. They aren't exciting fields, but they mean the template always knows what it gets, and the editor never has to guess where a piece of information belongs.
Templates split into small parts
The templates follow WordPress's own template hierarchy: archive-case.php and single-case.php, the same for packages, and a front-page.php for the front page. The case page itself is assembled from small template parts: hero, summary, sections, gallery, testimonial, sidebar and related cases. That makes it easy to change one place and see the effect on every case.
Small details that save time
A few details that made the site easier to run:
- The front page showed the three most important services, sorted by a weight the editor set. If fewer than two services were published, it fell back to fixed text so the front page never looked empty.
- A shortcode and a block pattern for a grid of services, so the same component could be used inside regular pages.
- Two calculators on the service pages, one for hours and one for price estimates, so a visitor could get a sense of the size of a job.
- Pages the theme depends on are created automatically. If the contact page is missing, for example, the theme creates it, so a new environment doesn't need manual setup.
- Danish translations of the theme's own strings in a
.pofile.
What the editor gets out of it
The result is an editor that fits the content. To create a new case, the editor fills in the fields a case has, and the template does the rest. There are no layout decisions to make and no blocks to move around. That may sound limiting, but it's exactly what keeps the site looking consistent and tidy years later.
A REST API on top of WordPress
WordPress has a built-in REST API, but it reflects WordPress's own data model, not necessarily the one the site is built around. So I built a standalone plugin that exposed the site's content under its own namespace, /wp-json/gearloose/v1.
The plugin worked like this:
- Every request requires an API key in a header. The keys are stored in a WordPress option, so they can be rotated without changing code.
- A status endpoint reports whether the API is running and which version it is.
- Cases, posts, services and partners can be listed, fetched, created, updated and deleted. Deleting moves items to the trash, so a mistake can be undone.
- Images are uploaded first and then referenced by their ID as a featured image, case logo or partner logo.
- ACF fields can be written through the API, so a case can be created complete with logo and key figures.
That made it possible to create and maintain content from scripts and automations, not only through the admin panel. In practice it was a light headless setup: WordPress was still the CMS, but the content could be read and written by other tools.
One small practical detail: WordPress doesn't allow SVG uploads by default, because they can contain code. So logos were converted to PNG before upload. That kind of thing is worth knowing up front if you plan to automate content.
Headless WordPress, briefly
Headless means WordPress only handles the content, while a separate application handles displaying it. The frontend fetches data from the API and builds the pages itself, for example in React.
The upside is that editors keep a system they know, while the frontend can be built exactly the way the project needs. The downside is that you now run two things instead of one, and many plugins that expect to control the frontend stop working. Headless WordPress makes the most sense when the editors are happy with WordPress but the frontend has needs a theme can't meet.
Where I've used WordPress
Gearloose's own site
gearloose.dk used to run on the theme described above: custom post types for cases, packages, services and partners, ACF fields in git, template parts for each part of a case, calculators on the service pages and Danish translations. It was a good site, and it was built to be maintained.
Nordic Power Services
Nordic Power Services has a modular custom theme with its own post types for products, use cases and cases, and six versioned ACF field groups. The pages are built from modular sections, so new pages can be assembled from existing parts.
The most useful part is an importer that creates the whole product catalogue automatically when the theme is activated. The products live as data in the theme, and the importer adds them as posts of the right type. A new environment can be set up from scratch without manual data entry, and a test environment always has the same content you developed against.
The theme also uses Composer and WordPress stubs, so the editor knows WordPress's functions and can catch mistakes before the code reaches the server.
Plugins as small internal tools
WordPress is also a good platform for small internal tools. I've built plugins for planning menus for administration and for instructors at an organisation that already had its site in WordPress. The users were already there, login was already there, and there was no reason to set up yet another system for a single feature.
A checklist for WordPress projects
These are the things I think through on a new WordPress project. It's general good practice, not a guarantee, but most problems I've seen on WordPress sites come from one of these points being forgotten.
- Hosting with PHP and database versions that still get security updates. Ideally with a staging environment, so changes can be tested before they hit the live site.
- A plan for updates. WordPress, themes and plugins need updating continuously. Decide who does it and how often.
- Few plugins, and good ones. Every plugin is code that needs maintaining and can have security holes. Choose actively maintained plugins, and remove the ones you don't use.
- Backups of both the database and uploads, stored somewhere other than the server, and a test that a backup can actually be restored.
- Basic security. Strong passwords and two-factor login for administrators, only the users and roles you need, and no passwords or keys in git.
- Theme and fields in git. The custom theme and ACF field groups are versioned, so the site can be rebuilt.
- Content model before design. Work out which types of content there are before building templates.
- An exit plan. Can the content be pulled out in a structured format if your needs change? Your own API, or at least a well-thought-out data model, makes that much easier.
When I moved off WordPress
My own site outgrew WordPress when I wanted two languages as part of the content model, content models versioned in code and the same stack as my client projects. Today it runs on React and Payload.
The custom REST API made the move far easier. Here are the steps, the way I did it.
1. Map the content
First, an overview of every content type in WordPress and what it corresponds to in the new CMS. Partners, cases, packages and blog posts each got their own collection in Payload, with fields matching the old ACF fields.
2. Write a migration script you can run again
The script read from the WordPress API and logged in to Payload's API. For each document it looked for an existing document with the same slug. If it existed, it was updated. Otherwise it was created. That means the script can run again and again without creating duplicates, so you can fix a mistake and just run it again.
3. Move the images
Images were downloaded from WordPress and uploaded to Payload's media library again, with alt text. Each image was uploaded only once per run, even if several documents used it. The documents then reference the image by its new ID.
4. Handle the details
- Slugs. Danish titles with æ, ø and å were turned into ae, oe and aa, so the URLs came out clean.
- Excerpts. If a case had no excerpt, one was made from the start of the body text with the HTML stripped.
- Packages. Price, duration, benefits and tags were mapped to matching fields. The benefits became a list instead of a single block of text.
- Only published blog posts. Drafts in WordPress weren't moved.
5. Rewrite the body text
The hardest part was the body text. There's no good automatic conversion from WordPress HTML to Payload's rich text format. HTML from WordPress often contains leftovers from old editors, inline styles and blocks that make no sense outside WordPress. So the body text was rewritten and entered as structured content, case by case and post by post.
It took time, but it was also a good opportunity to review the content. Much of it needed updating anyway.
6. Redirects and launch
The old URLs were redirected to the new ones, so inbound links and search rankings weren't lost. The new site ran on a separate preview domain until everything had been reviewed, and only then was the domain switched.
If your WordPress site has a proper API, it's much easier to move the content the day you want to move on.
When to stay on WordPress
That I moved doesn't mean everyone should. If your site is mostly content, your editors are happy with WordPress and there's nothing you're missing, there's rarely a good reason to switch. A migration costs time and money, and the gain needs to be clear.
There's good reason to consider a switch if:
- You're struggling with multilingual support that feels bolted on and not part of the site.
- The site has to connect closely with an app, a webshop with unusual flows or another platform.
- Plugins and updates take more time than the content itself.
- You want the content model versioned and reviewed as code.
Otherwise it's often better to clean up the existing site: a proper theme, fewer plugins and a clear content model.
The upside of WordPress
- Fast to launch. For sites without complex application needs, WordPress is hard to beat on time.
- Editor-friendly. With ACF and a custom theme, editors get a clean and predictable editor.
- Huge ecosystem. The integration you need probably already exists as a well-tested plugin.
- Can go headless. With a custom REST API, WordPress can be the backend for a modern frontend or for automations.
- A way forward. Built properly, the content can be moved the day your needs change.
Looking for a Payload CMS developer in Denmark? Read more about how I work with Payload.
Working in the same stack?
Do you build with WordPress yourself, are you thinking about going headless, or do you want to move a WordPress site to something else? I have experience with custom themes, REST APIs and migrating to Payload, and I'm happy to share what I've learned. Get in touch.

