PHPackages                             dbout/wp-orm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. dbout/wp-orm

ActivePackage[Database &amp; ORM](/categories/database)

dbout/wp-orm
============

WordPress ORM with Eloquent.

v4.3.1(9mo ago)1279.6k↓30.6%10[1 issues](https://github.com/dimitriBouteille/wp-orm/issues)[5 PRs](https://github.com/dimitriBouteille/wp-orm/pulls)1MITPHPPHP &gt;=8.2CI passing

Since Aug 13Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/dimitriBouteille/wp-orm)[ Packagist](https://packagist.org/packages/dbout/wp-orm)[ Docs](https://github.com/dimitriBouteille/wp-orm)[ RSS](/packages/dbout-wp-orm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (39)Used By (1)

WordPress ORM with Eloquent
===========================

[](#wordpress-orm-with-eloquent)

[![GitHub Release](https://camo.githubusercontent.com/4eae96476be306d8f2db8353cfa1850b14654b390361e95621c07e453648c20c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f64696d69747269426f757465696c6c652f77702d6f726d)](https://github.com/dimitriBouteille/wp-orm/releases)[![Tests](https://camo.githubusercontent.com/dfeada672449b9d81899e3e44277fb0b0cdfae76efb354726db7c3f944e4bf6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64696d69747269426f757465696c6c652f77702d6f726d2f74657374732e796d6c3f6c6162656c3d7465737473)](https://github.com/dimitriBouteille/wp-orm/actions/workflows/tests.yml)[![Packagist Downloads](https://camo.githubusercontent.com/cb92a5567e5ae0dae5007ed7e638d98c529ebfacbf4ca4735b59c49341cd0de6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64626f75742f77702d6f726d3f636f6c6f723d79656c6c6f77)](https://packagist.org/packages/dbout/wp-orm)[![Eloquent version](https://camo.githubusercontent.com/ea7394ef66a3840cdd23d3e7092152fe963c93757064340143020c9355a0738b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f64626f75742f77702d6f726d2f696c6c756d696e61746525324664617461626173653f636f6c6f723d6f72616e6765)](https://github.com/dimitriBouteille/wp-orm/blob/main/composer.json)[![Coverage Status](https://camo.githubusercontent.com/751715513dd608ecf606911ecacc7e78a41be412aca73d1cef16a3563729f2f8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f64696d69747269426f757465696c6c652f77702d6f726d2f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/dimitriBouteille/wp-orm)

WordPress ORM with Eloquent is a small library that adds a basic ORM into WordPress, which is easily extendable and includes models for core WordPress models such as posts, post metas, users, comments and more. The ORM is based on [Eloquent ORM](https://laravel.com/docs/eloquent) and uses the WordPress connection (`wpdb` class).

Tip

To simplify the integration of this library, we recommend using WordPress with one of the following tools: [Bedrock](https://roots.io/bedrock/), [Themosis](https://framework.themosis.com/) or [Wordplate](https://github.com/wordplate/wordplate#readme).

Features
--------

[](#features)

- ✅ Support core WordPress models: `Comment`, `Option`, `Post`, `TermTaxonomy`, `Term`, `User`, `PostMeta` and `UserMeta`
- ✅ Support core WordPress post type: `Article`, `Attachment` and `Page`
- ✅ Based on core WordPress database connection (`wpdb` class), no configuration required !
- ✅ Custom functions to filter models with meta
- ✅ Meta casting (e.g. [Attribute Casting](https://laravel.com/docs/eloquent-mutators#attribute-casting))
- ✅ Multisite support
- ❤️ Easy integration of a custom post and comment type
- ❤️ Easy model creation for projects with custom tables
- ❤️ All the features available in Eloquent, are usable with this library !

**Not yet developed but planned in a future version:**

- 🗓️ [Create migration tool with Eloquent](https://github.com/dimitriBouteille/wp-orm/issues/28)

Documentation
-------------

[](#documentation)

This documentation only covers the specific points of this library, if you want to know more about Eloquent, the easiest is to look at [the documentation of Eloquent](https://laravel.com/doc/eloquent).

You can find all the documentation in [the wiki](https://github.com/dimitriBouteille/wp-orm/wiki).

Installation
------------

[](#installation)

**Requirements**

The server requirements are basically the same as for [WordPress](https://wordpress.org/about/requirements/) with the addition of a few ones :

- PHP &gt;= 8.2
- [Composer](https://getcomposer.org/)

**Installation**

You can use [Composer](https://getcomposer.org/). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed.

```
composer require dbout/wp-orm
```

In your `wp-config.php` make sure you include the autoloader:

```
require __DIR__ . '/vendor/autoload.php';
```

🎉 You have nothing more to do, you can use the library now! Not even need to configure database accesses because it's the `wpdb` connection that is used.

Contributing
------------

[](#contributing)

We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our [contributing guidelines](CONTRIBUTING.md) to find out how to raise a pull request.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance75

Regular maintenance activity

Popularity40

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 93.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Recently: every ~74 days

Total

24

Last Release

159d ago

Major Versions

v1.0.0 → v2.0.02023-09-25

v2.0.0 → 3.0.0-beta.62024-01-29

3.3.0 → 4.0.0-alpha.02024-10-09

v4.3.1 → v5.0.0-alpha.02025-12-07

PHP version history (5 changes)v1.0.0PHP &gt;=7.2

v2.0.0PHP ^7.4|^8.0

3.0.0-beta.6PHP &gt;=8.1

4.0.0-alpha.0PHP &gt;=8.2

v5.0.0-alpha.1PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e5be30a5fa3cbb2c1ec8b80f81d752a6700dbca5a9ab419a508293e68fbde7c?d=identicon)[dimitriBouteille](/maintainers/dimitriBouteille)

---

Top Contributors

[![dimitriBouteille](https://avatars.githubusercontent.com/u/34821762?v=4)](https://github.com/dimitriBouteille "dimitriBouteille (521 commits)")[![rafaucau](https://avatars.githubusercontent.com/u/25438601?v=4)](https://github.com/rafaucau "rafaucau (14 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (12 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (11 commits)")

---

Tags

databaseeloquenteloquent-databaseeloquent-ormmigration-toolmysqlormwordpresswordpress-developmentwordpress-ormwordpress-starterwordpressmigrationdatabaseormsqleloquentdbwp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dbout-wp-orm/health.svg)

```
[![Health](https://phpackages.com/badges/dbout-wp-orm/health.svg)](https://phpackages.com/packages/dbout-wp-orm)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[tareq1988/wp-eloquent

Eloquent ORM for WordPress

57254.7k](/packages/tareq1988-wp-eloquent)[chocofamilyme/laravel-tarantool

A Tarantool based Eloquent ORM and Query builder for Laravel

182.3k](/packages/chocofamilyme-laravel-tarantool)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
