PHP or JavaScript for WordPress? What Hobbyist Devs Actually Need to Learn
If you use WordPress, start with PHP
That’s the short answer. If your goal is to read your site’s code, understand what a child theme is doing, or make careful manual edits without breaking things, PHP is what you need. WordPress is written in PHP. Template files are PHP. The functions.php file is PHP. The hooks-and-filters system that controls nearly every behavior on a WordPress site — all PHP.
JavaScript is important too, and yes, it’s increasingly central to WordPress development. But the JavaScript that matters lives mostly in the Gutenberg block editor and in interactive UI layers. For someone who wants to understand existing site code rather than build new block-based features from scratch, PHP is where the useful stuff is.
What WordPress actually runs on
WordPress’s core is PHP. As of 2026, PHP powers around 72% of all websites with a known server-side language, and WordPress alone accounts for roughly 43% of the web. That’s not legacy inertia — that’s the actual infrastructure of the internet built on this language.
When you look at a theme’s files, you see PHP. When you edit a child theme, you write PHP. When a plugin hooks into page rendering or modifies a database query, that’s PHP. Even posts and pages get assembled by PHP before anything reaches the browser.
PHP 8.x (the current major branch) is cleaner and faster than PHP 5 ever was. Many of the complaints you might have read about the language are outdated. It now has typed function signatures, named arguments, enums, match expressions, and a lot of modern features that weren’t there a decade ago. The “PHP is ugly” reputation is mostly from pre-2020 code.
Where JavaScript actually comes in
The WordPress block editor — Gutenberg — is built on React. If you want to write custom blocks, build interactive admin interfaces, or contribute to Gutenberg itself, you need JavaScript. Specifically React.
Full Site Editing (FSE), which shipped as stable in recent WordPress versions, also leans heavily on JavaScript for the editing experience. It’s the direction WordPress is heading for visual site-building.
But here’s the thing. None of that is where a hobbyist maintaining a couple of blogs and a sports club site needs to go first. The parts of WordPress a casual developer actually touches — the template hierarchy, the Loop, post meta, shortcodes, plugin action hooks — are all PHP. JavaScript block development is a separate skill set, closer to frontend React development than to WordPress customization.
The “learn JavaScript” advice is aimed at a different audience
When you read that JavaScript is the language to learn now, the people writing that are usually talking to developers who want to build React apps, full-stack Node.js projects, or distributable Gutenberg blocks. That’s a reasonable recommendation for them.
For someone who wants to understand what their WordPress theme is doing and make targeted edits, that advice doesn’t quite fit. You’d end up learning async JavaScript and React component patterns before you could do the first useful thing on your own site.
PHP gets you to “I understand this template file and I can modify it safely” in a much shorter time. The language is synchronous by default, reads top-to-bottom, and the WordPress-specific functions — get_the_title(), the_content(), get_posts(), add_action() — are well-documented and predictable. You already know Python, so loops, conditionals, and functions won’t be unfamiliar. PHP’s basic syntax won’t feel alien.
A practical learning path for WordPress hobbyists
A reasonable sequence if you’re starting from your background:
- Get comfortable with PHP basics — variables, arrays, functions, loops. Any general PHP tutorial covers this in a few hours, and a lot of it will map to what you already know from Python.
- Learn how the WordPress template hierarchy works. This is the map that tells you which PHP file controls which part of your site’s output.
- Create a child theme (if you haven’t already) and make small edits there rather than touching the parent theme directly. This protects you from updates overwriting your changes.
- Learn what hooks are — actions and filters. These are how WordPress lets you modify behavior without editing core files. This is where PHP in WordPress gets genuinely interesting, and it’s also how almost every plugin you use works under the hood.
WPMU Dev’s getting-started guide and WPShout’s free PHP for WordPress course are both solid. Neither assumes you already know server-side programming.
When JavaScript becomes worth adding
Once you’re comfortable with PHP and you find yourself wanting interactive behavior on the front end — a form that validates without reloading, a real-time filter, a small widget talking to an external API — that’s when JavaScript pays off.
At that point you’re not learning it to understand WordPress internals. You’re learning it to add browser-side behavior your site doesn’t have yet. That’s a natural second step.
And if you ever want to build custom Gutenberg blocks properly, React will eventually be necessary. But that’s a different project, and most hobbyists maintaining existing sites never need to go there.
Sources
