A WordPress site is built from five core components: the core software, a database, themes, plugins, and content. The core software handles requests and runs logic, the database stores everything from posts to user data, themes control presentation, plugins extend functionality, and content includes posts, pages, and media.
Core software, database, themes, plugins, and content make up a WordPress site.
WordPress runs as PHP code on a web server, typically paired with a MySQL or MariaDB database. When a visitor loads a page, the server executes WordPress core, which queries the database for the requested content, applies the active theme’s templates to format it, and injects any plugin-modified logic before sending the final HTML to the browser. Themes and plugins do not change the core codebase; they interact with it using hooks (actions and filters) and template files.
How WordPress Core Works Behind the Scenes
WordPress core includes thousands of PHP files organized into directories: wp-admin for the dashboard interface, wp-includes for shared functions and classes, and the root directory for front-end entry points like index.php and xmlrpc.php. When a request arrives, WordPress uses rewrite rules to map clean URLs (like /about) to internal query variables (like ?page_id=5). The request then passes through the template loader, which selects the appropriate template file from the active theme based on the content type (e.g., page.php for pages, single.php for blog posts).
Database tables and what they store
By default, WordPress creates about 12 tables in the database. Key ones include:
wp_posts– holds all posts, pages, attachments, revisions, and custom post types (title, content, status, date)wp_postmeta– stores additional data for posts, like featured image IDs or custom fieldswp_usersandwp_usermeta– user accounts and profile fields (roles, capabilities)wp_terms,wp_term_taxonomy,wp_term_relationships– categories, tags, and custom taxonomieswp_options– site-wide settings (site URL, admin email, plugin options, widget configurations)
Each table uses a prefix (often wp_), which you can change during installation to improve security. The database connection details (host, name, username, password) are stored in wp-config.php, not inside the database itself.
Themes Decide How Your Site Looks and Feels
A theme is a collection of files that control layout, typography, colors, and overall design. Every theme must include at least two files: style.css (which declares theme metadata like name and author) and index.php (the fallback template). Modern themes often use functions.php to enqueue scripts, register navigation menus, add theme support for features like featured images, and define sidebars.
Template hierarchy in practice
WordPress follows a strict fallback system when choosing a template. For a single blog post, it looks for (in order): single-post-{post_type}.php, single.php, index.php. For a category archive, it checks: category-{slug}.php, category-{id}.php, category.php, archive.php, index.php. This hierarchy lets you override default behavior with minimal code changes. You can preview theme changes on a staging site before switching live by using the Theme Preview feature in the dashboard (Appearance > Themes > Preview).
Child themes for safe customization
To modify a theme without losing updates, create a child theme. It requires two files: a style.css header declaring Template: parent-theme-folder-name, and a functions.php file that enqueues the parent stylesheet. Place any modified templates (e.g., page.php) or new template parts in the child theme folder. WordPress automatically loads child theme files first, then falls back to the parent. This keeps your edits isolated and upgrade-safe.
Plugins Add Functionality Without Touching Core Code
Plugins hook into WordPress using actions and filters. An action runs at a specific point (like saving a post or displaying the footer), while a filter modifies data before it is used (like changing the post content or adding a field to the login form). You can write custom plugins, but most users install pre-built ones from the WordPress.org repository or premium marketplaces.
What plugins actually change
Plugins can modify the database schema (adding custom tables), register new post types or taxonomies, inject JavaScript for interactive features, or override theme templates. For example, a contact form plugin might add a shortcode that renders an HTML form and processes submissions via AJAX. A caching plugin could intercept output buffering to store static HTML versions of pages. Because plugins run on every request, poorly written or outdated ones can slow the site or cause errors.
Checking plugin health
To test if a plugin is causing issues, deactivate all plugins via the dashboard (Plugins > Installed Plugins > Deactivate) or by renaming the wp-content/plugins folder via FTP or file manager. Reactivate them one by one until the problem returns. Also check the error log (often at /wp-content/debug.log after enabling WP_DEBUG_LOG in wp-config.php) for PHP errors or warnings. Plugins should meet these minimum standards: declare a minimum PHP version, use WordPress coding standards, and avoid overriding core functions directly.
Content Is Stored and Managed Separately From Code
Content lives entirely in the database. Posts, pages, media, comments, and custom post types (like products or events) are stored as rows in wp_posts, with metadata in wp_postmeta. Media uploads (images, PDFs) are stored in the /wp-content/uploads folder, organized by year and month. When you insert an image into a post, WordPress stores only the file path and metadata (alt text, caption) in the post content, not the file itself.
How content moves between environments
Moving content from a local or staging site to production requires exporting the database (Tools > Export > Download Export File) and copying the wp-content/uploads folder. Use a search-and-replace tool (like WP-CLI’s search-replace command) to fix URLs in the database, because serialized data (like widget settings) breaks if you simply replace text. Never edit the database directly with phpMyAdmin for URL changes—use dedicated tools to preserve serialized structures.
Custom fields and structured data
For non-standard content (like event dates or product prices), use custom fields. WordPress core includes a basic Custom Fields meta box in the post editor, but most users install Advanced Custom Fields (ACF) or Gutenberg blocks. Blocks let you structure content visually within the editor. Each block saves as a JSON string in the post content, making it easier to render consistently across themes.
Security and Maintenance Are Part of the Anatomy
Security in WordPress is layered: core updates patch known vulnerabilities in the PHP code, plugin updates fix security flaws in third-party extensions, and file permissions (e.g., 644 for files, 755 for directories) prevent unauthorized execution. The wp-config.php file should define secure keys (available at https://api.wordpress.org/secret-key/1.1/salt/) and restrict file editing (add define('DISALLOW_FILE_EDIT', true); to disable the built-in theme/plugin editor).
Automated updates and when to turn them off
WordPress supports automatic updates for minor core releases (like 6.4.1 to 6.4.2) and plugin/theme updates if enabled in Settings > Updates. Major core updates (like 6.4 to 6.5) require manual approval. You can disable all automatic updates by adding define('WP_AUTO_UPDATE_CORE', false); to wp-config.php, but this increases risk. Test updates on a staging site first, especially for plugins that modify database tables or front-end behavior.
Backups and recovery basics
At minimum, back up the database and wp-content folder weekly. Tools like UpdraftPlus or WP-CLI’s wp db export and tar -czf wp-content.tar.gz wp-content create portable snapshots. Restoring involves importing the SQL file into the database and extracting the wp-content archive over the existing folder. After restoration, clear any caching plugins or server-level caches (like OPcache) to avoid stale content.
Understanding the anatomy helps diagnose problems faster. If the site shows a white screen, check the PHP error log and verify the database connection in wp-config.php. If the dashboard is missing, confirm the wp-admin folder exists and has correct permissions. If content appears broken, look for plugin conflicts or missing template files. Most issues trace back to one of the five core pieces failing to communicate correctly.
WordPress Site Components That Often Get Confused
| Component | Stored Where | Updated How | Changes Affect |
|---|---|---|---|
| Core software | Server files (wp-admin, wp-includes) |
Dashboard > Updates or manual upload | All sites on the installation | Theme | /wp-content/themes/theme-name |
Dashboard > Appearance > Themes or FTP upload | Visual layout and some functionality (via templates) |
| Plugin | /wp-content/plugins/plugin-name |
Dashboard > Plugins > Install Now or FTP upload | Site behavior, database, or front-end logic |
| Content | Database (wp_posts, wp_postmeta) |
Dashboard editor or import/export | Only the data, not appearance or code |
Confusing these leads to common mistakes. For example, editing a theme file directly (instead of using a child theme) means changes vanish when the theme updates. Installing too many plugins can overload the database with options in wp_options, slowing queries. Uploading large media files without optimizing them first can fill disk space quickly. Knowing where each piece lives helps you fix issues without breaking other parts.
What Happens When You Install a New Theme or Plugin?
Installing a theme copies its files into /wp-content/themes/theme-name and adds a folder entry to the database’s wp_options table under allowed_themes. Activating it sets the template and stylesheet options to the theme folder name. The site then uses the theme’s functions.php and template files for rendering. No database schema changes occur unless the theme explicitly adds custom post types or taxonomies in code.
Installing a plugin copies its folder into /wp-content/plugins/plugin-name. Activation runs any register_activation_hook function, which may create database tables or set default options. Deactivation runs register_deactivation_hook, which typically removes temporary data but leaves options intact. Uninstalling deletes the plugin folder and, if the plugin supports it, runs an uninstall.php script to clean up its database entries.
If a plugin fails during activation, the site may show a fatal error. To recover, rename the plugin folder in wp-content/plugins (e.g., add .old), which deactivates it automatically. Then check the error log to see why activation failed—often a PHP version mismatch or missing dependency.
Common Misunderstandings About WordPress Anatomy
“Themes control all site behavior.” False. Themes handle presentation and some structural logic (like menu locations), but core logic and plugin functionality live outside the theme folder. Changing themes won’t fix broken plugin features.
“Plugins add database tables automatically.” Not always. Many plugins store settings in wp_options as serialized arrays. Only complex plugins (e.g., e-commerce or membership) typically create custom tables. Check the plugin’s documentation or source code for CREATE TABLE queries if you need to know.
“My content disappears if I change themes.” Content stays in the database. However, some themes expect specific custom fields or post formats. If the new theme doesn’t support them, the data may not display correctly, but it’s still there in the database.
How to Verify Your Site’s Health Visually
Check these five things in order: 1) Dashboard loads? (confirms core and database connection) 2) Front page shows content? (confirms theme templates and rewrite rules) 3) Plugin features work? (confirms plugin activation and hooks) 4) Media uploads succeed? (confirms file permissions and disk space) 5) Forms submit without errors? (confirms AJAX handlers and server configuration). If any step fails, narrow the scope by deactivating plugins or switching themes temporarily.
Use the Site Health tool (Tools > Site Health) to run automated checks. It verifies PHP version, database collation, HTTPS status, and file permissions. Red items indicate critical issues; yellow items are warnings. Fix red items before proceeding—especially those about file permissions or PHP version.
WordPress Anatomy for Large Batches and Kids
When managing multiple sites, use multisite (Network Setup under Tools) to share one core installation across many sites. Each site has its own database tables (with a numeric suffix like wp_2_posts) but shares users and plugins. This saves disk space and simplifies updates, though plugin compatibility can be stricter.
For children or beginners, focus on content creation first. Use a simple theme like Twenty Twenty-Four, disable all plugins except essential ones (like a contact form), and avoid custom code. The dashboard’s block editor (Gutenberg) guides users with visual blocks—no HTML knowledge needed. Once they understand posts and pages, introduce media, menus, and widgets gradually.
Teaching kids to back up before theme changes builds good habits. Show them how to preview a theme before switching, and explain that plugins are like add-ons that add features (like photo galleries or social sharing) without changing the site’s look. Emphasize that the database is the “memory” storing what they create, while themes are the “outfit” for that memory.