Module 1: WordPress Foundations
How WordPress Works
WordPress powers a very large share of the websites on the internet, from personal blogs to news organisations, online shops and company sites. For a web developer in Kenya or anywhere else, it is one of the most commercially useful skills you can have: many small and medium businesses want a site they can update themselves, and WordPress is often the tool they ask for by name. Before you install anything, you need a clear picture of what WordPress is and how its pieces fit together, because almost every problem you will meet later makes sense once you understand this structure.
WordPress.org versus WordPress.com
The name refers to two related things, and confusing them causes many wrong decisions:
| WordPress.org (self-hosted) | WordPress.com (hosted service) | |
|---|---|---|
| What it is | Free, open-source software you install on your own hosting | A commercial service run by Automattic that hosts WordPress for you |
| Control | Full: any theme, any plugin, your own code | Depends on the plan; lower plans restrict plugins and themes |
| Responsibility | You handle hosting, updates, backups and security | Much of the maintenance is handled for you |
This course focuses on self-hosted WordPress from WordPress.org, because that is what most developers build for clients. Plans and features on hosted services change, so check their current offers if a client is considering one.
The building blocks
A WordPress site has four main parts:
- WordPress core: the PHP application itself, which handles users, content, the admin dashboard, the editor and the system that turns a web address into a page.
- The database: usually MySQL or MariaDB. It stores your posts, pages, settings, users and comments. Uploaded images are stored as files, but their details are recorded in the database.
- Themes: control how the site looks. Only one theme is active at a time.
- Plugins: add features such as contact forms, SEO tools, online shops or backups. You can have many active plugins.
On the server, a WordPress installation looks like this:
public_html/
wp-admin/ WordPress core: the dashboard
wp-includes/ WordPress core: libraries
wp-content/
themes/ installed themes
plugins/ installed plugins
uploads/ your images and files, organised by year/month
wp-config.php database connection and key settings
index.php
.htaccess web server rules (on Apache servers)
The golden rule: never edit core files in wp-admin or wp-includes. Updates replace them, and your changes would be lost. Everything that belongs to your site lives in wp-content and wp-config.php.
What happens when someone visits a page
- A visitor requests
https://example.co.ke/services/. - The web server passes the request to WordPress's
index.php. - WordPress loads its settings, active plugins and active theme.
- It works out what the address refers to (here, the page with the slug "services") and fetches it from the database.
- The theme's templates build the HTML around that content: header, navigation, content area, footer.
- The finished page is sent to the visitor's browser.
Because pages are built on each request, WordPress sites benefit greatly from caching, which you will study in the speed optimisation lesson.
Worked example: matching a client's needs
A Nairobi physiotherapy clinic wants a site with service pages, a blog with exercise tips, a booking request form and a page listing their insurance partners. In WordPress terms: services and the insurance list are pages, tips are posts, the booking form comes from a plugin, the look comes from a theme customised to their brand, and the content is stored in the database. Thinking this way lets you scope the job, choose tools and estimate time before you start.
Common mistakes to avoid
- Editing core files. Your changes disappear at the next update and can break the site.
- Choosing WordPress.com when the client needs a specific plugin, without checking whether their plan allows it.
- Treating WordPress as "install and forget". Self-hosted sites need updates, backups and security care, which you will learn in the last module.
- Forgetting the database. Copying only the files does not copy the site. Content lives in the database.
Exercise
Choose a local business you know, such as a salon, school or restaurant, and write down what their website would need. Sort every item into one of four columns: page, post, plugin feature or theme or design decision. Note whether they would be better served by self-hosted WordPress or a hosted service, with one sentence explaining why.
Key points
- Self-hosted WordPress (WordPress.org) gives full control but you are responsible for maintenance.
- A site is core plus a database plus one active theme plus plugins.
- Never edit core files; your site's own files live in wp-content and wp-config.php.
- Content lives in the database, so files alone are not the whole site.