How does WordPress work?

It all started with HTML

When I started designing websites years ago all of my websites were made in static HTML. HTML is the code language that is used to create a web page and stands for Hyper Text Markup Language. It is essentially a set of instructions that tell your web browser how to render a web page.

Later CSS or Cascading Style Sheets were in addition to HTML used for styling and designing a web page. With CSS you can give instructions to a web browser how to style all the elements of a web page. For instance, we can tell to display a header in a different font-size, colour, font type etc. HTML and CSS together will give a web designer all the tools to build a superb looking website.

Static website; HTML combined with CSS.

Static website; HTML combined with CSS.

In order to update such a web site one needs to go through a lot of code and this was normally the job for a skilled web designer. The website’s owner didn’t have much chance of updating their website unless they were willing to learn coding. That’s why the term Static Website was used.

But then the Content Management Systems (CMS) were invented. These CMS allow a website owner to update their website in a simple way, much like creating a Word document, without the knowledge of HTML coding. WordPress is the most popular CMS nowadays, powering more than 25% of all websites.

How does WordPress work?

This post is intended to give you a better understanding of what actually happens in the background when you create or edit WordPress posts or pages. Or, How does WordPress work?

WordPress still uses HTML and CSS, but it also utilizes another coding language called PHP, which is a recursive acronym for PHP: Hypertext Preprocessor. This language is used in combination with HTML to let a website “talk” to a database.

You can compare a database to an Excel spreadsheet. It consists of many tables with rows and columns and cells. In this database WordPress stores everything you type, photos you upload and any other information that is important for create your website. So when you make a new post, the title you give it will be stored in the database, the category you give it will also be stored in the database, and so on.

On your website the page or post you created contains the right code to retrieve this data from the database. With Static HTML all information that is needed to display your web page is included in one HTML file. A web designer needs to create a new file for each and every page. With PHP and a database there is no need for that. The developer only needs to make one page template that can be used every time again. This page template contains references to the database and tells which database items (title, content, category etc.) to insert in the right place.

WordPress connects to a database.

There is much more to it, but to keep things really simple this is how it works. In the administration area of WordPress you basically just fill in a form, much like any other form in the internet. You use form fields to enter a title and main content. You tick boxes to add a post to a category etc. This information is then stored in the database. Once you click on the Publish/Update button the post/page template is used on your website to create a new post/page.