PHPackages                             lyfter/wp-query-builder - 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. lyfter/wp-query-builder

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

lyfter/wp-query-builder
=======================

1.0.0(2y ago)351PHPPHP ^8.2

Since Apr 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lyfter/wp-query-builder)[ Packagist](https://packagist.org/packages/lyfter/wp-query-builder)[ RSS](/packages/lyfter-wp-query-builder/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Wp Query Builder
================

[](#wp-query-builder)

A package that allows you to create WP\_Queries in a more elegant while offering you autocompletion in you IDE. Heavily inspired by Laravel Elequent and query builder.

Replace

```
$query = new WP_Query([
    'posts_per_page' => 5,
    'post_type' => 'page'
]);

$query->get_posts();

```

With

```
WpQuery::build()
    ->type('page')
    ->limit(5)
    ->get();

```

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

[](#installation)

#### Install with composer

[](#install-with-composer)

Run the following in your terminal to install the package with Composer.

```
$ composer require lyfter/wp-query-builder

```

The package uses [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloading and can be used with the Composer's autoloader. Below is a basic example of getting started, though your setup may be different depending on how you are using Composer.

```
require __DIR__ . '/vendor/autoload.php'; // Not required when using bedrock

use Lyfter\QueryBuilder\WpQuery;

$posts = WpQuery::build()
    ->type(['post', 'page'])
    ->limit(5)
    ->get();
```

See Composer's [basic usage](https://getcomposer.org/doc/01-basic-usage.md#autoloading) guide for details on working with Composer and autoloading. basic usage guide for details on working with Composer and autoloading.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

801d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18738854?v=4)[Lyfter](/maintainers/lyfter)[@lyfter](https://github.com/lyfter)

---

Top Contributors

[![peters97](https://avatars.githubusercontent.com/u/8708442?v=4)](https://github.com/peters97 "peters97 (8 commits)")

### Embed Badge

![Health badge](/badges/lyfter-wp-query-builder/health.svg)

```
[![Health](https://phpackages.com/badges/lyfter-wp-query-builder/health.svg)](https://phpackages.com/packages/lyfter-wp-query-builder)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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