Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Developer · Info

Is WordPress Written in PHP? The Languages Behind WordPress

Is WordPress Written in PHP? The Languages Behind WordPress

Short answer

Yes, WordPress is written mainly in PHP, which runs on the server and builds each page. The block editor and Site Editor are written in JavaScript using React, content is stored in a MySQL or MariaDB database, and the pages visitors see are HTML and CSS. WordPress recommends PHP 8.3 or newer.

Key takeaways

  • PHP powers WordPress core, themes' templates and most plugins on the server.
  • The block editor is a JavaScript application built with React.
  • Content and settings live in a MySQL or MariaDB database.
  • Visitors receive HTML, CSS and JavaScript, not PHP.
  • You do not need to know PHP to use WordPress, but it helps to customize it.

What programming language is WordPress written in?

WordPress is written mostly in PHP, a server-side language, with a large JavaScript codebase for the editor and SQL for talking to its database.

When someone visits a WordPress page, the web server runs WordPress's PHP code. That code reads content from the database, applies your theme and plugins, and sends finished HTML to the browser.

The WordPress About page describes the platform as built on PHP and MariaDB and licensed under the GPL.

Here is how the main languages fit together:

Language or technologyWhat it does in WordPress
PHPRuns core, builds pages, handles logins, plugins and theme templates
JavaScript and ReactPowers the block editor, Site Editor and interactive features
SQL (MySQL or MariaDB)Stores posts, pages, users and settings
HTMLThe structure of every page visitors see
CSSColors, fonts and layout of the site and the editor
JSONBlock settings, theme.json design tokens and REST API responses

Why does WordPress use PHP?

WordPress began in 2003 as a PHP blogging tool, and PHP remains a good fit because it is supported by almost every web host and is designed for generating web pages.

PHP was already the standard for web applications when WordPress started, and nearly every shared host supported it. That made WordPress easy to install anywhere, which helped it spread.

PHP itself has changed a lot since then. Modern versions are much faster and add features such as types and better error handling. The PHP supported versions page shows which versions still get security fixes.

The huge base of WordPress sites also means changing language would break millions of themes and plugins. Improving PHP compatibility over time is the more practical path.

Which PHP version does WordPress need?

WordPress recommends PHP 8.3 or newer, along with MySQL 8.4 or newer or MariaDB 10.11 or newer, and HTTPS support.

These recommendations are listed on the official WordPress requirements page. WordPress can still run on older PHP versions, but they are slower and some no longer receive security updates.

You can see your site's PHP version under Tools > Site Health > Info > Server. If it is old, our guide on updating the PHP version in WordPress shows how to upgrade safely.

Plugins can set their own minimum. WooCommerce, for example, has announced that version 11.6 will require PHP 8.1 or newer.

How does PHP build a WordPress page, step by step?

When a visitor requests a page, PHP loads WordPress, works out which content was asked for, fetches it from the database, picks a template and outputs HTML, unless a cache serves a ready copy first.

The sequence looks roughly like this:

  1. The web server receives the request and hands it to PHP
  2. WordPress loads its settings from wp-config.php and connects to the database
  3. Core, active plugins and the theme load, and plugins register their hooks
  4. WordPress reads the URL and decides which post, page or archive it means
  5. It queries the database for that content
  6. The template hierarchy picks the right template from the theme
  7. Blocks and template code turn the content into HTML
  8. The finished page, with CSS and JavaScript links, goes to the browser

Page caching skips most of these steps by saving the finished HTML. That is why caching makes such a big speed difference: PHP and the database do far less work for each visitor.

PHP's speed also matters for pages that cannot be cached, such as carts, account pages and the admin area. Newer PHP versions run the same WordPress code faster, which is one more reason to keep PHP up to date.

Is the block editor written in PHP too?

No, the block editor is a JavaScript application built with React, developed in the open in the Gutenberg project, while PHP on the server registers blocks and renders some of them.

The editor runs entirely in your browser. When you add or move blocks, JavaScript handles it, and the editor talks to WordPress through the REST API to save your work.

The code lives in the public Gutenberg repository on GitHub, where features are developed before they reach WordPress core.

Some blocks are rendered by PHP on the server, such as the Latest Posts or Query Loop blocks, because their output depends on database content that changes.

Do themes and plugins use PHP?

Yes, classic themes and most plugins are written in PHP, while block themes use mostly HTML templates and a theme.json file, with optional PHP.

A classic theme has PHP template files such as single.php and page.php. A block theme stores templates as HTML files with block markup, and design settings in theme.json.

Plugins usually combine PHP for server logic with JavaScript for editor features or interactive parts of the page. Custom blocks need both: block.json and JavaScript for the editor, and PHP for registration or server rendering.

Our guide to creating a custom block shows how those pieces fit together.

Do you need to learn PHP to use WordPress?

No, you can build and run a full WordPress site without writing any PHP; learning it becomes useful when you want custom features, your own plugins or deeper theme changes.

Most site owners never touch code. Themes, the block editor and plugins cover design and features through the dashboard.

If you want to customize WordPress, start with the basics of PHP and the WordPress hook system. Our guide on how to code in WordPress is a practical starting point.

For front-end and editor work, JavaScript and React matter more. The Block Editor Handbook covers that side of WordPress development.

Can WordPress be used without PHP on the front end?

Yes, in a headless setup WordPress still runs on PHP behind the scenes, but a separate JavaScript front end built with a framework displays the content it fetches through the REST API.

This approach suits apps and sites that need a custom front end, but it adds complexity and loses some WordPress features such as themes and many plugins' front-end output.

Our guide to building a headless WordPress site explains when that trade-off makes sense.

Where is WordPress's PHP code?

WordPress core's PHP code sits in the wp-admin and wp-includes folders and the main files in your site's root, while your themes and plugins live in wp-content.

You should never edit core PHP files directly, because updates replace them. Our explainer on what WordPress core is covers those files and why custom code belongs in plugins.

Frequently asked questions

Is WordPress built with PHP or JavaScript?

Both. The core system, page generation and most plugins run on PHP on the server. The block editor and Site Editor are JavaScript applications built with React that run in your browser.

What database does WordPress use?

WordPress uses a MySQL or MariaDB database. For current installations, WordPress recommends MySQL 8.4 or newer, or MariaDB 10.11 or newer, running alongside a recent PHP version.

Is PHP still worth learning for WordPress?

Yes. PHP runs WordPress core and most plugins, so it is essential for custom plugin and theme development. JavaScript is also important if you want to build blocks or editor features.

Can WordPress run on Python or Node.js?

No. WordPress itself requires PHP. You can use Python or Node.js for a separate front end or tools that talk to WordPress through its REST API, but the WordPress server still runs PHP.

Why does my host ask me to update PHP for WordPress?

Older PHP versions stop receiving security fixes and run more slowly. Hosts move customers to newer versions to stay secure, and WordPress recommends PHP 8.3 or newer.

Sources

  1. About WordPress WordPress.org
  2. Requirements WordPress.org
  3. Supported Versions PHP.net
  4. Gutenberg repository GitHub
  5. Block Editor Handbook WordPress Developer Resources

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.