PHPackages                             angelxmoreno/wprestclient - 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. [API Development](/categories/api)
4. /
5. angelxmoreno/wprestclient

ActiveLibrary[API Development](/categories/api)

angelxmoreno/wprestclient
=========================

WPRestClient is a PHP library for seamless WordPress site interaction via the RESTful API

v1.2.1(1y ago)52361[3 issues](https://github.com/angelxmoreno/WPRestClient/issues)MITPHPPHP ^7.4

Since Jun 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/angelxmoreno/WPRestClient)[ Packagist](https://packagist.org/packages/angelxmoreno/wprestclient)[ RSS](/packages/angelxmoreno-wprestclient/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

[![Codacy Badge](https://camo.githubusercontent.com/8e817742091653d7c75d756da638409f6b5730e697abc324aabdf96bfe7f76f6/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3737353864396636353462663464303762313330633933393331323035643039)](https://app.codacy.com/gh/angelxmoreno/WPRestClient/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![codecov](https://camo.githubusercontent.com/434fec28d8d47f7db92ac0d4636d4caa4f79aea7f1c84b01e4747cc824ebfd79/68747470733a2f2f636f6465636f762e696f2f67682f616e67656c786d6f72656e6f2f575052657374436c69656e742f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d3330354d584c4a47394a)](https://codecov.io/gh/angelxmoreno/WPRestClient)[![GitHub license](https://camo.githubusercontent.com/ae39ef3e260add6fb255b3f892c3ceb911ae37eec0ec3c966eb9680aa08af6a1/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f616e67656c786d6f72656e6f2f575052657374436c69656e74)](https://github.com/angelxmoreno/WPRestClient/blob/master/LICENSE)[![Open Source? Yes!](https://camo.githubusercontent.com/33dfddb9625820bb8277bc598e5aae0c2e4c3e8f5bd0c0c958ae28502e4250bc/68747470733a2f2f62616467656e2e6e65742f62616467652f4f70656e253230536f757263652532302533462f5965732532312f626c75653f69636f6e3d676974687562)](https://camo.githubusercontent.com/33dfddb9625820bb8277bc598e5aae0c2e4c3e8f5bd0c0c958ae28502e4250bc/68747470733a2f2f62616467656e2e6e65742f62616467652f4f70656e253230536f757263652532302533462f5965732532312f626c75653f69636f6e3d676974687562)[![PHP Version 7.4+](https://camo.githubusercontent.com/1150142271e92a6b30ce3ef37f5548f25d15d1e9cd200eea972f746cc7a2c40a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d626c7565)](https://camo.githubusercontent.com/1150142271e92a6b30ce3ef37f5548f25d15d1e9cd200eea972f746cc7a2c40a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d626c7565)[![Maintenance](https://camo.githubusercontent.com/5ca62441414bacaa54c6c6e5b68e46c76305947b6bf498c4949fc71c1b4b10dd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d7965732d677265656e2e737667)](https://GitHub.com/angelxmoreno/WPRestClient/graphs/commit-activity)

[![WPRestClient Logo](docs/assets/WPRestClient.github.png)](docs/assets/WPRestClient.github.png)

### a PHP WordPress API Client

[](#a-php-wordpress-api-client)

WPRestClient is a PHP library for seamless interaction with WordPress sites via the WordPress RESTful API, simplifying authentication, data retrieval, and content management tasks

Features
--------

[](#features)

- Connect to WordPress sites and authenticate using REST API authentication methods.
- Retrieve posts, pages, custom post types, categories, tags and other WordPress entities.
- Create, update and delete posts and pages.
- Perform advanced queries and filter responses using the power of the WordPress RESTful API.
- Use the [APIClient](https://wprestclient.readthedocs.io/en/latest/usage/client) for low level calls
- Use [Repositories](https://wprestclient.readthedocs.io/en/latest/usage/repositories) and gain WordPress entity objects
- [Configurable API Prefix](https://wprestclient.readthedocs.io/en/latest/extending/api-prefix)
- [Create custom entities](https://wprestclient.readthedocs.io/en/latest/extending/entity) or extend the existing ones
- [Create custom repositories](https://wprestclient.readthedocs.io/en/latest/extending/repository) for any endpoint

Requirements
------------

[](#requirements)

PHP 7.4+

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

[](#installation)

You can install WPRestClient via Composer. Run the following command in your project directory:

```
composer require angelxmoreno/wprestclient
```

Usage
-----

[](#usage)

1. Create a new instance of the WPRestClient:

    ```
    use WPRestClient\Core\ApiClient;

    $client = new ApiClient('https://example.com');
    ```
2. Retrieve a raw array of posts via the client:

    ```
    $posts = $client->sendRequest('get','/posts');
    foreach ($posts as $post) {
        echo $post['title']['rendered'];
    }
    ```
3. Retrieve an array `PostEntity` objects via the `PostsRepository`:

    ```
    use WPRestClient\Repository\PostsRepositor;

    PostsRepository::setApiClient($client);
    $posts = PostsRepository::fetch();
    foreach ($posts as $post) {
       echo $post->getTitle();
    }
    ```
4. Create a new Page via the `PagesRepository` using the `RepositoryRegistry`: By creating an instance of `RepositoryRegistry`, you have access to all the registered repositories with the `ApiClient` already set.

    ```
    use WPRestClient\Repository\PagesRepository;
    use WPRestClient\Core\RepositoryRegistry;
    use WPRestClient\Entity\PageEntity;

    $registry = new RepositoryRegistry($client);
    $page = new PageEntity(['title' => 'A New Page']);
    $registry->pages()->create($page);
    ```
5. Delete a post via the `PostsRepository` using the `RepositoryRegistry`:

    ```
    use WPRestClient\Repository\PagesRepository;
    use WPRestClient\Core\RepositoryRegistry;
    use WPRestClient\Entity\PageEntity;

    $registry = new RepositoryRegistry($client);
    $post = $registry->posts()->get(123);
    $registry->posts()->delete($post);
    ```

For more detailed usage examples and available methods, please refer to the [documentation](https://wprestclient.readthedocs.io/en/latest/).

Contribution
------------

[](#contribution)

Contributions are welcome! If you find a bug, have suggestions for improvements, or would like to add new features, please submit an issue or a pull request. Make sure to follow our [contribution guidelines](https://wprestclient.readthedocs.io/en/latest/contributing/)

License
-------

[](#license)

WPRestClient is open-source software licensed under the [MIT license](LICENSE)

Contact
-------

[](#contact)

For any questions or inquiries, please contact

Support
-------

[](#support)

For bugs and feature requests, please use the [issues](https://github.com/angelxmoreno/WPRestClient/issues) section of this repository.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance21

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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

Every ~135 days

Total

4

Last Release

665d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58aebae1bf475954887c4c975a24950aa32c0dd34026400fa0303f7a43672389?d=identicon)[angelxmoreno](/maintainers/angelxmoreno)

---

Top Contributors

[![angelxmoreno](https://avatars.githubusercontent.com/u/363479?v=4)](https://github.com/angelxmoreno "angelxmoreno (83 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/angelxmoreno-wprestclient/health.svg)

```
[![Health](https://phpackages.com/badges/angelxmoreno-wprestclient/health.svg)](https://phpackages.com/packages/angelxmoreno-wprestclient)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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