core

PHP

PHP is a server-side scripting language that runs on your web host and generates HTML before sending it to a visitor's browser. WordPress is written almost entirely in PHP — every page load, admi...

PHP

PHP is a server-side scripting language that runs on your web host and generates HTML before sending it to a visitor’s browser. WordPress is written almost entirely in PHP — every page load, admin action, and plugin function executes PHP code on the server.

Last verified: April 2026


Answer capsule

PHP is a server-side scripting language that processes WordPress code on your hosting server and returns finished HTML to the visitor’s browser. WordPress core, themes, and plugins are all written in PHP. The version running on your server directly affects site speed, security, and plugin compatibility.


What does PHP do in WordPress?

When someone visits your WordPress site, the server runs PHP to query the database, apply your theme, execute plugin logic, and assemble the final page — all before a single byte reaches the visitor’s browser. PHP version 8.1 and above is required for WordPress 6.3+, per the official WordPress requirements.

Why does the PHP version on your server matter?

PHP 8.2 runs roughly 20–30% faster than PHP 7.4 on equivalent hardware, according to benchmarks published on php.net. We see this regularly on client sites: upgrading from PHP 7.4 to 8.2 drops admin-panel response times noticeably without touching a single plugin. Outdated PHP versions also lose security patches — PHP 7.4 reached end-of-life in November 2022 and receives no security updates.

How do you check or change your PHP version?

In most shared hosting control panels (cPanel, Plesk, MyKinsta), PHP version is a one-dropdown change. In our testing across SiteGround, Hostinger, and Kinsta, updating PHP takes under two minutes. Before upgrading, run the PHP Compatibility Checker plugin to flag any installed plugins that break on newer versions — we find at least one incompatible plugin on roughly 1 in 3 client sites during upgrades.

A quick example

Your wp-config.php file is pure PHP. The line that defines your database name looks like this:

define( 'DB_NAME', 'your_database_name' );

WordPress reads this when it boots. If PHP stops executing — due to a version conflict or syntax error — your entire site goes blank (the classic “white screen of death”).


Additional reading