PHPackages                             fastwhale/wordpress-php-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fastwhale/wordpress-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fastwhale/wordpress-php-sdk
===========================

WordPress Laravel PHP SDK

1.5.4(10mo ago)033LGPL-3.0-or-laterPHPPHP &gt;=5.6

Since Dec 11Pushed 10mo agoCompare

[ Source](https://github.com/fastwhale/WordPress-PHP-SDK)[ Packagist](https://packagist.org/packages/fastwhale/wordpress-php-sdk)[ Docs](https://www.madeit.be)[ GitHub Sponsors](https://github.com/fastwhale)[ RSS](/packages/fastwhale-wordpress-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

WordPress API PHP SDK
=====================

[](#wordpress-api-php-sdk)

[![Build Status](https://camo.githubusercontent.com/289c86f44e805fe11ead21cedc35fa1b0d639633f1ae8607a962a6397e312c35/68747470733a2f2f7472617669732d63692e6f72672f6d616465495442656c6769756d2f576f726450726573732d5048502d53444b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/madeITBelgium/WordPress-PHP-SDK)[![Coverage Status](https://camo.githubusercontent.com/1b920d651e547943226a6495c8fea2b6920b2ec37af5887dde724f0bb17db1b8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d616465495442656c6769756d2f576f726450726573732d5048502d53444b2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/madeITBelgium/WordPress-PHP-SDK?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/3cfb2a6ca1e3ee56a46c4fa3eb2f5cc048ceb0ca788f4d79d0476f3e9daddc38/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f576f726450726573732d5048502d53444b2f762f737461626c652e737667)](https://packagist.org/packages/madeITBelgium/WordPress-PHP-SDK)[![Latest Unstable Version](https://camo.githubusercontent.com/bd090cd38cbcea5d01b65c80fb39a8b348d5d5ff51fbeac69d0b97540c22853a/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f576f726450726573732d5048502d53444b2f762f756e737461626c652e737667)](https://packagist.org/packages/madeITBelgium/WordPress-PHP-SDK)[![Total Downloads](https://camo.githubusercontent.com/5c8d1be07f121dfe622e085cbef1310e8be491e473e16cd4b1386b44bd495909/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f576f726450726573732d5048502d53444b2f642f746f74616c2e737667)](https://packagist.org/packages/madeITBelgium/WordPress-PHP-SDK)[![License](https://camo.githubusercontent.com/0ca2ecb91746dec557db944abc141b5fd5ab208ea8bc549d5921ca94574d1d9e/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f576f726450726573732d5048502d53444b2f6c6963656e73652e737667)](https://packagist.org/packages/madeITBelgium/WordPress-PHP-SDK)

Installation
============

[](#installation)

Require this package in your `composer.json` and update composer.

```
composer require fastwhale/wordpress-php-sdk
```

After updating composer, add the ServiceProvider to the providers array in `config/app.php`

```
Fastwhale\WordPress\WordPressServiceProvider::class,
```

You can use the facade for shorter code. Add this to your aliases:

```
'WP' => Fastwhale\WordPress\WordPressFacade::class,
```

Add the config files

```
php artisan vendor:publish --provider="Fastwhale\WordPress\WordPressServiceProvider"
```

Documentation
=============

[](#documentation)

Authentication
--------------

[](#authentication)

To use authenticated requests you have to sign in to the WordPress website to generate a JWT token. WordPress doesn't support this by default, you have to install a JWT compatible plugin. This package is tested with:

```
use Fastwhale\WordPress\WordPressFacade as WordPress;
$token = WordPress::login($request->get('email'), $request->get('password'));
// {'token': '...'}
```

Now you can save the `$token->token` to your database.

```
use Fastwhale\WordPress\WordPressFacade as WordPress;
WordPress::setAccessToken($token);

```

### Application Password

[](#application-password)

You can use the newly introduced Application Password (in WordPress 5.6).

```
$wp = WordPress::setServer('https://www.example.com')
    ->setUsername('username')
    ->setApplicationPassword('application password');

```

Interact with objects
---------------------

[](#interact-with-objects)

### User

[](#user)

WordPress Rest API documentation:

```
use Fastwhale\WordPress\WordPressFacade as WordPress;
$users = WordPress::user()->list();
$result = WordPress::user()->create($data);
$user = WordPress::user()->get($id);
$result = WordPress::user()->update($id, $data);
$result = WordPress::user()->delete($id);

```

### Post

[](#post)

WordPress Rest API documentation:

```
use Fastwhale\WordPress\WordPressFacade as WordPress;
$users = WordPress::post()->list();
$result = WordPress::post()->create($data);
$user = WordPress::post()->get($id);
$result = WordPress::post()->update($id, $data);
$result = WordPress::post()->delete($id);

```

### Post from custom post type

[](#post-from-custom-post-type)

WordPress Rest API documentation:

```
use Fastwhale\WordPress\WordPressFacade as WordPress;
$users = WordPress::customPost('custom_post_type')->list();
$result = WordPress::customPost('custom_post_type')->create($data);
$user = WordPress::customPost('custom_post_type')->get($id);
$result = WordPress::customPost('custom_post_type')->update($id, $data);
$result = WordPress::customPost('custom_post_type')->delete($id);

```

### Tags

[](#tags)

WordPress Rest API documentation:

```
use Fastwhale\WordPress\WordPressFacade as WordPress;
$users = WordPress::tag()->list();
$result = WordPress::tag()->create($data);
$user = WordPress::tag()->get($id);
$result = WordPress::tag()->update($id, $data);
$result = WordPress::tag()->delete($id);

```

### Create new post

[](#create-new-post)

```
$data = [
    'title' => 'title',
    'parent' => 0,
    'slug' => Str::slug('title', '-'),
    'content' => 'content',
];
$post = WordPress::post()->create($data);
// {'id': ...}

```

### Uploading media

[](#uploading-media)

```
use Illuminate\Support\Facades\Storage;
use Fastwhale\WordPress\WordPressFacade as WordPress;

$media = WordPress::postCall('/wp-json/wp/v2/media', [
    'multipart' => [
        [
            'name' => 'file',
            'contents' => Storage::disk('local')->get($fileLocation),
            'filename' => 'filename.jpg',
        ],
        [
            'name' => 'title',
            'contents' => 'Title of attachment',
        ],
        [
            'name' => 'alt_text',
            'contents' => 'Alt text',
        ],
    ],
]);

```

Execute any request
-------------------

[](#execute-any-request)

Read more about the WordPress rest API:

### Get

[](#get)

```
$url = "";
$result = WordPress::getCall('/wp-json'.$url);

```

### Put

[](#put)

```
$result = WordPress::putCall('/wp-json'.$url, $data);

```

### Post

[](#post-1)

```
$result = WordPress::postCall('/wp-json'.$url, $data);

```

### Delete

[](#delete)

```
$result = WordPress::deleteCall('/wp-json'.$url);

```

The complete documentation can be found at:

Support
=======

[](#support)

Support github or mail:

Contributing
============

[](#contributing)

Please try to follow the psr-2 coding style guide.

License
=======

[](#license)

This package is licensed under LGPL. You are free to use it in personal and commercial projects. The code can be forked and modified, but the original copyright author should always be included!

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance54

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.5% 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 ~104 days

Total

3

Last Release

314d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22ecd713318e756f10dba01c3f7b56a2012cebe3c64d72261d0be24a03d11342?d=identicon)[fastwhale](/maintainers/fastwhale)

---

Top Contributors

[![madeITBelgium](https://avatars.githubusercontent.com/u/20304892?v=4)](https://github.com/madeITBelgium "madeITBelgium (35 commits)")[![DoveChen](https://avatars.githubusercontent.com/u/12093494?v=4)](https://github.com/DoveChen "DoveChen (4 commits)")[![fastwhale](https://avatars.githubusercontent.com/u/143690859?v=4)](https://github.com/fastwhale "fastwhale (1 commits)")

---

Tags

phplaravelwordpress

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/fastwhale-wordpress-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/fastwhale-wordpress-php-sdk/health.svg)](https://phpackages.com/packages/fastwhale-wordpress-php-sdk)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[monicahq/laravel-cloudflare

Add Cloudflare ip addresses to trusted proxies for Laravel.

3372.7M4](/packages/monicahq-laravel-cloudflare)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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