Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 68 ยท Getting Started

What Is WordPress?

Learn what WordPress is, how a CMS separates content from design, the difference between wordpress.org and wordpress.com, and what you will build in this course.

WordPress is a content management system (CMS): a PHP application that stores your content in a database and turns it into web pages when a visitor asks for them. You write a post in a friendly editor, press Publish, and WordPress takes care of the URL, the HTML, the menus, the feeds and the search. Nobody edits about.html by hand.

It is also the most widely used website software in the world, running a large share of all websites. That popularity is the reason to learn it: clients, employers and open-source projects all need developers who understand how it works underneath. This course teaches that "underneath" part: themes, hooks, queries, plugins, the REST API, blocks and security.

You should be comfortable with basic PHP before you start. If not, begin with Introduction to PHP and Functions.

The big idea: content in a database, design in templates

A static site has one file per page. A CMS splits the work in two:

  1. Content lives in database tables (posts, pages, comments, users, settings).
  2. Presentation lives in template files (PHP in classic themes, HTML with block markup in block themes).

When a request arrives, WordPress works out which content is wanted, loads it, picks a template and fills the template with the content.

flowchart LR
    V["Visitor requests /hello-world"] --> C["WordPress core<br/>(PHP)"]
    C --> D[("Database<br/>posts, options, users")]
    D --> C
    C --> T["Theme template<br/>single.php or single.html"]
    T --> H["HTML sent to the browser"]

Core fetches the content, the theme decides how it looks, and the visitor receives plain HTML.

Here is that idea in miniature. This is not WordPress code; it is a plain-PHP stand-in that keeps "posts" in an SQLite table and renders them through a template function. Real WordPress does the same job with MySQL or MariaDB and far more machinery.

PHP Content in a database, rendered by a template

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with fgets(STDIN)), it gets the next line from this box.

Change a title in the INSERT and the page changes without touching the template. Change the template and every page changes without touching the content. That separation is the whole point of a CMS.

The three layers: core, themes and plugins

Every WordPress site is built from three kinds of code:

Layer What it is Where it lives Who changes it
Core The WordPress software itself: query engine, admin screens, REST API, editor wp-admin/, wp-includes/ and the root files WordPress contributors; you only update it
Theme Controls how the front end looks and which templates are used wp-content/themes/ You, or a theme author
Plugin Adds features (forms, SEO, shops) wp-content/plugins/ You, or a plugin author

A rule you will repeat for the rest of your career: never edit core files. The next update would erase your changes. Instead, WordPress gives you hooks, named points in the code where themes and plugins can add behavior or change data. Hooks get their own chapter starting with Actions and Filters.

The stand-in below shows the idea. The "core" function builds a page title and lets registered "plugins" adjust it, without core knowing anything about them.

PHP A plugin changes behavior without editing core

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with fgets(STDIN)), it gets the next line from this box.

The first line prints the title unchanged. After the two "plugins" register, the second line prints HELLO WORLD | My Blog. Real WordPress calls these add_filter() and apply_filters() and adds priorities, extra arguments and removal.

wordpress.org versus wordpress.com

The names are confusing, so get them straight:

  • WordPress.org is the home of the open-source software. You download it for free, install it on your own hosting and have full control: any theme, any plugin, any code.
  • WordPress.com is a commercial hosting service run by Automattic that uses the same software. Lower plans restrict plugins and custom code; higher plans allow them.

This course is about the self-hosted software from WordPress.org, because that is where developers work. Almost everything you learn also applies to sites on higher WordPress.com plans.

From idea to live site

If you build a self-hosted site for a client or for yourself, four pieces have to come together:

  1. A domain name. The address visitors type (example.com). It is rented yearly from a registrar. The part after the last dot is the top-level domain (TLD): .com, .org, a country code like .de, or newer ones such as .dev. Choose a short, memorable name that is easy to spell, and keep the registration private and on auto-renew.
  2. Hosting. A server that runs PHP and MySQL and serves your files. Shared hosting is cheapest but shares resources with other sites; managed WordPress hosting (for example Kinsta or WP Engine) adds caching, backups and updates for a higher price; a VPS or cloud server gives full control and needs server skills. Look at speed, uptime, support, backups, PHP version and location close to your visitors.
  3. DNS and SSL. Point the domain's name servers (or an A record) to the host, and turn on a free SSL/TLS certificate so the site loads over HTTPS.
  4. The WordPress install. Most hosts offer a one-click installer. Otherwise you download WordPress, create a database and user, upload the files and run the famous five-minute install in the browser (see Anatomy of an Install).

After the install you choose a theme, add a few plugins and start creating content; the next chapters of this course take you from the dashboard to writing your own code. Before that, Local Development Environment shows how to practise on your own computer without paying for any of the above, and Managing Posts, Pages, Categories and Tags starts the dashboard chapter.

Versions and the 6.x release cycle

WordPress uses a numbered scheme such as 6.7 or 6.8. The first two numbers form a major release, which brings new features. A third number, as in 6.8.1, is a minor release for security and bug fixes. Major releases arrive a few times a year, and security updates are backported to older versions.

Two practical points follow. First, keep sites updated; many hacked sites run old software. Second, WordPress is strict about backward compatibility: code written years ago usually still works, which is why you will see old functions next to new ones. This course targets WordPress 6.x and block themes, the modern way to build themes, but it also teaches classic themes because millions of sites still use them.

What you will build

By the end of the course you will be able to:

  • Read and write the loop and WP_Query to fetch content.
  • Build classic and block themes with the template hierarchy, theme.json and patterns.
  • Write plugins with hooks, custom post types, taxonomies, meta boxes, shortcodes and settings pages.
  • Expose and consume data through the REST API, and build your own blocks.
  • Protect a site with nonces, capability checks, sanitizing and escaping.
  • Ship four complete projects: a portfolio theme, an events plugin, a contact form and a reading list.

What runs here and what does not

WordPress needs a web server, PHP and MySQL, and this site's runner cannot start those. So every lesson follows the same honest rule:

  • Real WordPress code appears in read-only code blocks. You copy it into your own installation to run it.
  • Runnable examples are plain-PHP stand-ins that reproduce the idea (a hook system, a query builder, a template resolver) so you can experiment right here. Each lesson says clearly which is which.

Stand-ins are simplified. They teach the mechanism, not every edge case of the real functions, so always check the official developer documentation when you write production code. Here is what real WordPress code looks like, for comparison. It is a template file from a classic theme, shown read-only:

PHP
<?php while ( have_posts() ) : the_post(); ?>
	<article>
		<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
		<?php the_excerpt(); ?>
	</article>
<?php endwhile; ?>

have_posts(), the_post(), the_permalink(), the_title() and the_excerpt() are all real WordPress functions. You will meet them properly in The Loop.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main idea behind a CMS such as WordPress?

    A CMS keeps content in a database and combines it with templates when a page is requested, so design and content can change independently.
  2. 2. Which statement about WordPress.org and WordPress.com is correct?

    WordPress.org distributes the open-source software for self-hosting. WordPress.com is a commercial hosting service that runs it.
  3. 3. Why should you never edit WordPress core files?

    Updates overwrite core. Use hooks, themes and plugins to change behavior so your code survives updates.
  4. 4. What does a third version number, as in 6.8.1, usually indicate?

    Major releases are the first two numbers; the third number marks minor releases that focus on fixes.

Summary

  • WordPress is a PHP CMS: content is stored in a database and rendered through templates.
  • Three layers: core (never edit), themes (look) and plugins (features).
  • Hooks let your code add behavior or change data without touching core.
  • WordPress.org is the free self-hosted software; WordPress.com is a hosting service.
  • Major releases (6.7, 6.8) add features; minor releases (6.8.1) fix problems. Keep sites updated.
  • On this site real WordPress code is read-only, and runnable examples are plain-PHP stand-ins.

Next up: Setting Up a Local WordPress Site.