What is WordPress?
WordPress is an open-source Content Management System (CMS) written in PHP and powered by a MySQL database.
In simple terms — it is a software that runs on a web server and lets you build and manage websites without reinventing the wheel every time. You get a ready-made system for storing content, managing users, handling routing, and rendering pages.
It was created in 2003 by Matt Mullenweg and Mike Little. Originally it was just a blogging tool. Today it powers 43%+ of all websites on the internet — from simple blogs to large-scale news portals, e-commerce stores, and streaming platforms.
How Does WordPress Work — The Big Picture
When a visitor opens your WordPress website in a browser, here is exactly what happens step by step:
Browser sends a request
↓
Web Server (Apache / Nginx) receives it
↓
WordPress index.php is triggered
↓
wp-config.php is loaded (database credentials)
↓
WordPress core files are loaded (wp-settings.php)
↓
Database is queried for the requested content
↓
Active theme templates are loaded
↓
Active plugins hook into the request
↓
Final HTML is generated and sent back to browser
↓
Browser renders the page
Every single page load goes through this flow. WordPress is not a compiled framework — it is a request-driven PHP application that runs top to bottom on every request.
The Core Technology Stack
|
Layer |
Technology |
|
Programming
Language |
PHP (8.0+
recommended) |
|
Database |
MySQL or
MariaDB |
|
Templating |
PHP files (no
separate engine) |
|
Frontend |
HTML, CSS,
JavaScript |
|
Web Server |
Apache or
Nginx |
Since you already know PHP, you already understand the language WordPress is written in. This is your biggest advantage. WordPress does not use a separate templating engine like Blade — your theme files are plain PHP files that mix PHP logic with HTML output.
WordPress Architecture — 3 Core Layers
WordPress is built in 3 distinct layers. Understanding this is critical.
Layer 1 — WordPress Core
This is the engine. It lives inside wp-admin/ and wp-includes/ folders. It handles:
- Routing (deciding which page to show)
- Database abstraction
- The hooks system (actions & filters)
- User authentication
- Plugin & theme loading
Rule: You never touch or modify core files. Ever. If WordPress updates, your changes will be wiped out.
Layer 2 — Themes
A theme controls how your website looks. It is a collection of PHP template files, CSS, and JavaScript. A theme handles presentation only — it should not add permanent functionality.
Layer 3 — Plugins
A plugin adds or extends functionality. It hooks into WordPress core and adds features — contact forms, custom post types, payment gateways, SEO tools, etc.
WordPress Core → the engine (never touch)
↓
Themes → controls appearance
↓
Plugins → adds functionality
What Makes WordPress Different from Laravel
Since you come from Laravel, here is a direct comparison so you understand WordPress's mental model:
|
Concept |
Laravel |
WordPress |
|
Routing |
routes/web.php |
Template
Hierarchy (automatic) |
|
Templating |
Blade
(.blade.php) |
Plain PHP
files |
|
Database ORM |
Eloquent |
WP_Query +
$wpdb |
|
Middleware |
Middleware
classes |
Hooks
(Actions & Filters) |
|
Service
Container |
IoC Container |
Plugin system |
|
Migrations |
php artisan
migrate |
dbDelta() |
|
Config |
.env +
config/ |
wp-config.php |
|
Controllers |
Controller
classes |
Template
files + functions.php |
|
Auth |
Laravel
Breeze / Sanctum |
Built-in
(wp_login, wp_register) |
The biggest mental shift is routing. In Laravel you define routes explicitly. In WordPress, routing is automatic based on the URL and what content exists in the database. WordPress decides which PHP template file to load — this system is called the Template Hierarchy, which we will cover in detail in Phase 2.
WordPress Database — Quick Overview
WordPress uses a MySQL database with a fixed table structure. When you install WordPress, it creates these tables automatically:
wp_posts → stores all content (posts, pages, CPTs, revisions)
wp_postmeta → custom fields / meta data for posts
wp_users → registered users
wp_usermeta → extra data for users
wp_terms → categories, tags, custom taxonomy terms
wp_term_taxonomy → links terms to their taxonomy type
wp_term_relationships → links posts to their terms
wp_options → site-wide settings & plugin data
wp_comments → user comments
wp_commentmeta → extra data for comments
wp_links → blogroll links (legacy, rarely used)
The most important table is wp_posts — it stores not just blog posts but every type of content in WordPress including pages, custom post types, navigation menus, and even revisions.
The WordPress Hook System — 1 Minute Intro
The hook system is what makes WordPress so extensible. It allows themes and plugins to plug into WordPress core at specific points without modifying core files.
There are two types of hooks:
Actions — let you execute your own code at a specific moment
add_action('wp_footer', function() {
echo '<p>This appears in every footer</p>';
});
Filters — let you modify a value before WordPress uses it
add_filter('the_title', function($title) {
return '🎬 ' . $title;
});
This is the foundation of everything in WordPress development. We will dedicate an entire phase to this.
Key Terminology You Must Know
|
Term |
Meaning |
|
Post |
Any piece of
content in WordPress (posts, pages, CPTs) |
|
CPT |
Custom Post
Type — a custom content type you define |
|
Taxonomy |
A way to
group posts (categories, tags, custom) |
|
Term |
A single item
inside a taxonomy (e.g. "Action" inside "Genre") |
|
Meta |
Extra data
attached to a post, user, or term |
|
Hook |
A point where
you can inject your own code |
|
Action |
A hook that
lets you run code at a specific moment |
|
Filter |
A hook that
lets you modify a value |
|
Loop |
The WordPress
mechanism for displaying posts |
|
Template |
A PHP file
that controls how a page looks |
|
Shortcode |
A [bracket]
tag that outputs dynamic content |
|
Nonce |
A security
token for forms and AJAX |
Summary
- WordPress is a PHP + MySQL CMS that handles routing, templating, and content management out of the box.
- It is built in 3 layers — Core, Themes, Plugins. You only ever work in themes and plugins.
- WordPress routing is automatic (Template Hierarchy) — unlike Laravel's explicit routes.
- The Hook System (Actions & Filters) is how everything in WordPress communicates.
- The database has a fixed structure —
wp_postsis the central table for all content.
No comments:
Post a Comment