PHPackages                             mehov/cakephp-wordpress - 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. mehov/cakephp-wordpress

ActiveCakephp-plugin[API Development](/categories/api)

mehov/cakephp-wordpress
=======================

CakePHP to Wordpress connector

02PHP

Since Nov 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mehov/cakephp-wordpress)[ Packagist](https://packagist.org/packages/mehov/cakephp-wordpress)[ RSS](/packages/mehov-cakephp-wordpress/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

CakePHP to Wordpress connector
==============================

[](#cakephp-to-wordpress-connector)

### Installation

[](#installation)

```
composer require mehov/cakephp-wordpress:dev-master

```

```
cp vendor/mehov/cakephp-wordpress/config/CakePHPWordpress-dist.php config/CakePHPWordpress.php
// don't forget to edit config/CakePHPWordpress.php

```

```
// src/Application.php::bootstrap()
$this->addPlugin(\CakePHPWordpress\Plugin::class, ['bootstrap' => true, 'routes' => false]);

```

```
// src/Controller/AppController.php::initialize()
$blogList = \Cake\Core\Configure::read('CakePHPWordpress.siteList');
$blogSymbol = array_keys($blogList)[0];
\Cake\Core\Configure::write('CakePHPWordpress.defaultSite', $blogSymbol);

```

### Usage

[](#usage)

#### Automatic - out of the box

[](#automatic---out-of-the-box)

Your posts should automatically be available.

The plugin will fetch your *Permalink structure* (as defined in your Wordpress admin - see `/wp-admin/options-permalink.php`) and connect it as a route in your host CakePHP application.

For example:

- **If you *Permalink structure* is `/myblog/%year%/%postname%/`**

    The plugin will identify that `myblog` is the base path and will be listening for everything under that path.
- **If you *Permalink structure* is `/%postname%/`**

    The plugin will be listening for everything. Conflicts may happen. Check your `APP/config/routes.php` to make sure no other route is hijacking the path where you expect your Wordpress content.

#### Manually fetching content

[](#manually-fetching-content)

```
// Wherever you need to get the Wordpress posts
$blog = new \CakePHPWordpress\Connector();
$query = $blog->Posts->find('all', []);
$query = $query->all();

```

#### Importing CSS from your blog

[](#importing-css-from-your-blog)

Normally, Wordpress would render some additional CSS with your content. You will need that CSS here to make sure your content looks like it should.

Provide links to the stylesheets you would like to load under `externalCss` in [`config/CakePHPWordpress.php`](./config/CakePHPWordpress-dist.php). The plugin will attempt to fetch the contents of these files and cache them locally.

```
'externalCss' => [
    // plugin that outputs all CSS that Wordpress would use
    'http://wordpress.example.com/wp-json/wordpress-export-css/wordpress-export-css.css',
    // static file; optional 'foo' becomes
    'foo' => '//wordpress.example.com/wp-includes/css/dist/block-library/style.css',
],
```

Normally, you would need `wp-includes/css/dist/block-library/style.css` as well as the inline styles that Wordpress generates dynamically. To get the latter, you can use [mehov/wordpress-export-css](https://github.com/mehov/wordpress-export-css).

Remember to clear the cache if you make changes to the `externalCss` configuration.

```
bin/cake cache clear_all

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0208168e1ededfaccca6305a05ea15d6f715e7266c9ad16347889f751b2f204e?d=identicon)[mehov](/maintainers/mehov)

---

Top Contributors

[![mehov](https://avatars.githubusercontent.com/u/7813306?v=4)](https://github.com/mehov "mehov (19 commits)")

### Embed Badge

![Health badge](/badges/mehov-cakephp-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/mehov-cakephp-wordpress/health.svg)](https://phpackages.com/packages/mehov-cakephp-wordpress)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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