Skip to content
WordPress

How to build a WordPress website: the approach I use today

Plan features before plugins, keep plugins few, use a child theme, work on a local copy, and take care of speed, security, backups and content.

WordPress badges on a wooden table
Photo: Lisa Risager from Denmark, CC BY-SA 2.0, via Wikimedia Commons

Questo articolo per ora è disponibile solo in inglese. La versione italiana è in preparazione.

I wrote the first version of this page in 2018. Since then WordPress has changed its editor, its themes and a good part of how you are supposed to build a site. What follows is the approach I use today for my own sites, this one included. It is not the only way, but it has saved me from the mistakes that cost the most time.

1. Decide what the site must do before you install anything

This was the main point of the old article and it still holds. Plugins store their data in the database in their own format. Pick a forms plugin, a shop plugin or a custom fields plugin, fill the site with content, and changing your mind later means a migration. Write down the features you need (blog, shop, bookings, multilingual, members) and choose the tools for those features first. The theme comes after.

A real example from this site: years ago I used a plugin called Block Lab for a custom “attachment” block. The plugin was discontinued, and every post that used the block still depends on it. If I were starting today I would build that block in the theme itself or with core blocks, so nothing external could break it.

2. Fewer plugins, chosen carefully

Every plugin is code running on every page load and a possible security hole. Before installing one I check three things: when it was last updated, how many active installations it has, and whether the same result can be had with a few lines in the theme. A typical small site needs very little: a cache, an SEO plugin, a backup tool, an anti-spam solution and a form plugin. If you count more than twenty active plugins, something can probably go.

3. Pick a theme that will survive updates

Modern block themes let you change header, footer and templates from the Site Editor, without touching PHP. If you need custom code, never edit the theme directly: create a child theme, so the parent can be updated without wiping your changes. Avoid themes that bundle dozens of features (sliders, page builders, shops); you pay for them in speed and you are tied to that theme forever.

4. Work on a copy, not on the live site

This is the change that made the biggest difference for me. I keep a full copy of the site on my computer, running in Docker (WordPress plus a MariaDB database), and the theme files under Git. I try every change locally, commit it, and only then publish the changed files to the server with a script that keeps a backup of what it overwrites. If something breaks, going back takes a minute. Many hosts also offer a one-click staging copy, which is a simpler way to get most of the benefit.

5. Speed

  • Use the cache your host supports (LiteSpeed Cache on LiteSpeed servers, for example) and a CDN if your audience is spread around the world.
  • Resize images before uploading and let WordPress serve WebP or AVIF. A 4 MB photo from a phone has no place in a blog post.
  • Keep scripts in check: every embed, chat widget or tracking tag adds weight. Load fonts from your own server.
  • Measure with PageSpeed Insights on mobile, not only on desktop, and look at the Core Web Vitals.

6. Security and backups

  • Update core, themes and plugins regularly, and remove what you do not use.
  • Use a strong password and two-factor login for every administrator.
  • Keep automatic backups of files and database somewhere other than the same server, and try a restore at least once. A backup you have never restored is a hope, not a backup.
  • Turn on comment moderation or an anti-spam service from day one. This site collected thousands of spam comments before I did.

7. Content and search engines

Clean permalinks, one clear title per page, a meta description that a person would want to click, and images with a meaningful alt text: an SEO plugin helps with the details. The rest is content. Search engines have become very good at telling apart pages written to answer a question from pages written to fill space. Old posts deserve attention too: updating or merging thin articles usually does more than publishing new ones.

8. Learn a little of the code

You can build a good site without writing code, but knowing the basics of how WordPress works (the template hierarchy, hooks, functions.php) turns many “impossible” requests into ten-line changes. A practical example on this site is how to use a different single.php depending on the category.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x