What programming languages does WordPress use?

Have you ever tried to tweak the code in your WordPress website? If so, you might have tried the Code Editor in Gutenberg — or clicked Edit in HTML in a text block. The WordPress classic editor also has a Text tab that reveals the code for a page as well. Regardless of the method you’ve used, you might wonder what code this is and how it works. Let’s take a look at the programming languages WordPress uses so you can understand a bit more about how it works.

HTML

HTML — hypertext markup language — is the basic markup language that any web page uses. HTML is a linear language, so it is easy to follow and easy to learn. Essentially, you simply write out the code for what you want on a web page in the order you want it to appear. HTML uses sensical tags for its elements — <img> for an image, <p> for a paragraph, <table> for a table, <b> for bold text, and so forth.

If you decide to edit your own HTML, be aware that many tags must be closed with a slash at the beginning of a tag. For example, if you want to add italic text manually, you can do so with <i>. When you no longer want italic text to appear, you can close the italics tag with </i> and nothing after that point will appear in italics. (Note, though, that styles like bold and italics can also be applied through style sheets, as you’ll see below.)

PHP

PHP is the backbone of WordPress from a development standpoint. WordPress itself is written in PHP, and themes and plugins are as well. PHP is a much more complicated programming language, so it’s probably best to leave PHP changes to seasoned WordPress developers.

JavaScript

JavaScript is a programming language that is best used for making instant changes to a web page as a response to user input. For example, JavaScript was used frequently in the Web’s early days for things like special “on click” behaviors — for example, something happens (other than simply opening a new web page) when a user clicks a link. JavaScript is also useful for mouse hover behaviors — making something pop up or change when a user hovers over something.

JavaScript also has numerous libraries that add additional functionality to it. In WordPress, Gutenberg blocks are created with a JavaScript library called React. Like PHP, React is more advanced, so if you want to add a specific block to Gutenberg, you’ll probably want to leave that to a seasoned developer. Even “simpler” block builders like ACF Blocks still use PHP, so while these options might be more accessible, there’s still an incredibly high learning curve.

In part two of this series, we continue looking into the languages WordPress uses with a look at CSS.

Comments