Is WordPress a PHP Framework?

„On the surface Wordpress is a content management system. It is used by most of its users as a content management system and it offers all of the features of a content management system.

However… I don’t see Wordpress as just a content management system. Really when you think about it, what is a framework, specifically: What is a PHP framework?

  • Routing – Wordpress offers the ability to have custom rewrite rules, capture URL parameters and do other things around routing out-of-the-box.
  • ORM/Database interface abstraction – Wordpress comes with a powerful database class with ORM capabilities that allow us to work with the database either indirectly through abstract methods or write raw queries (just like a PHP framework ORM most likely would).
  • Templating – By default Wordpress works on the basic premise of there being a certain hierarchy of files named a certain way. Technically your theme „index.php“ file is your main layout and entry point. From there on in, you can do things like; include partials, extend other templating files and do dynamic logic based on database data, AJAX requests and more.
  • Authentication/User management – Wordpress ships with a powerful role based authentication layer that is easily extendable. There are plugins out there that extend the authentication layer beyond what a lot of PHP frameworks can offer like; LDAP authentication, social authentication and more.
  • Administration panel – There is no PHP framework to my knowledge that ships with an extendable and aesthetically pleasing UI like Wordpress offers. Sure there are third party packages for frameworks like Laravel that give you an admin panel, but they require configuration to work with your application correctly.
  • Plugin architecture – Wordpress has a hook based plugin architecture that is both powerful and easy to use. Most internal aspects of Wordpress are configurable through action hooks and filters. You can even define your own hooks/filters to make your sites extensible via plugins.
  • Media management – I do not know of any PHP framework that offers the kind of out-of-the-box media management functionality that Wordpress does. The ability to handle, process and store various kinds of media from audio to video and photos.
  • Caching – I know most PHP frameworks offer caching functionality, but with Wordpress you not only get an out-of-the-box caching functionality that works, but there are millions of plugins out there offering more finer-grained caching control.

So yes: Wordpress is a PHP framework. It is by no means a drop-in replacement for all framework specific purposes, but it offers so much out-of-the-box, there are not really many situations where Wordpress would not be appropriate for the task at hand.“