PHPackages                             happyr/wordpress-bundle - 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. happyr/wordpress-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

happyr/wordpress-bundle
=======================

0.4.1(4y ago)165076[6 issues](https://github.com/Happyr/symfony-wpblog/issues)[1 PRs](https://github.com/Happyr/symfony-wpblog/pulls)MITPHPPHP &gt;=7.2CI failing

Since Nov 1Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Happyr/symfony-wpblog)[ Packagist](https://packagist.org/packages/happyr/wordpress-bundle)[ GitHub Sponsors](https://github.com/Nyholm)[ RSS](/packages/happyr-wordpress-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (8)Versions (8)Used By (0)

Happyr WordPress Bundle
=======================

[](#happyr-wordpress-bundle)

Let your editors write blog posts with Wordpress excellent backend but still deliver super quick responses, leverage Twig and integrate with your blog content with your Symfony application. As an extra bonus, this means that your WordPress application does not need to be exposed to the internet.

This is a small bundle that talks to the WordPress REST API. We make sure to cache each request so your blog do not get overwhelmed with requests.

WordPress configuration
-----------------------

[](#wordpress-configuration)

### Rewriting links

[](#rewriting-links)

We need to rewrite absolute URLs from WordPress. To make things easier for us, please set your page and post url prefix to "page".

[![Permalinks](/Resources/docs/image/permalinks.png)](/Resources/docs/image/permalinks.png)

### Invalidate cache

[](#invalidate-cache)

You should configure Symfony to be very aggressive when caching resources from WordPress. But when an editor makes an update you need to invalidate the cache and redownload the updated resource.

The Symfony bundle provides an endpoint to invalidate cache. You should use this endpoint when a post in updated and deleted.

(TODO add a small wordpress plugin for this in `Resources/Wordpress`)

Symfony installation
--------------------

[](#symfony-installation)

There are quite a few moving parts to set up this bundle. But they all make perfect sense. Lets take them one by one:

### API endpoint

[](#api-endpoint)

Where is your WordPress blog? You should define the endpoint to the build-in REST API. In the example below we assume you access your WordPress app with the following URL: `http://demo.wp-api.org`.

```
# /config/packages/happyr_wordpress.yaml
wordpress:
  url: 'http://demo.wp-api.org/wp-json'
```

### Templates

[](#templates)

The bundle comes with 2 default templates. One for an index page that list your latest posts and one template for a single post/page. You should of course replace these with something you like better. This could easily be done with some configuration:

```
# /config/packages/happyr_wordpress.yaml
wordpress:
  # ...
  controller:
    index_template: index.html.twig
    page_template: page.html.twig
```

### Routes

[](#routes)

To enable the default controllers you need to include the provided routes.yaml.

```
# /config/routes.yaml
wordpress:
    resource: '@WordpressBundle/Resources/config/routes.yaml'
    prefix: '/p' # optional
```

You may of course use your own controllers. Just make sure that you define a route named `happyr_wordpress_page`.

```
# /config/packages/happyr_wordpress.yaml
wordpress:
    # ...
    controller: false

```

```
# /config/routes.yaml
# ...

happyr_wordpress_page:
    path: /wp/{slug}
    methods: 'GET'
    controller: App\Controller\MyWordpressController::show
    requirements:
        slug: '.+'
```

### Caching

[](#caching)

WordPress is a great tool but it is slower than your Symfony application. Make sure we cache all responses from Wordpress. We use `Symfony\Contracts\Cache\CacheInterface`for caching because it got stampede protection built-in.

```
# /config/packages/happyr_wordpress.yaml
wordpress:
  # ...
  cache:
    service: 'App\Cache\SymfonyCache'
    ttl: 604800 # One week
```

### Parsers

[](#parsers)

When we fetch data from WordPress we need to parse it somehow. We need to make sure all links refer to the symfony application and not the WordPress application. We also need to handle the image references.

You may disable parses you do not want with configuration:

```
# /config/packages/happyr_wordpress.yaml
wordpress:
  # ...
  parser:
    image: false
    link: false
    url: false
```

You may also add your own parsers by register a new service and tag it with `happyr_wordpress.parser.page` or `happyr_wordpress.parser.menu`.

### Images

[](#images)

We do not want any references to images to go to the WordPress application. We need to download the image and upload it somewhere good. Like AWS S3. You can configure the `RewriteImageReferences` parser with a custom uploader to achieve this. Make sure your uploader implements `ImageUploaderInterface`.

```
# /config/packages/happyr_wordpress.yaml
wordpress:
  # ...
  parser:
    image:
      uploader: 'App\MyUploaderService'
```

The default uploader uploads images to a local folder. This is alright if there only is a few images and you have CloudFront or any other reverse proxy caches in front of your Symfony application.

```
 # /config/packages/happyr_wordpress.yaml
 wordpress:
   # ...
   local_image_uploader:
     local_path: '%kernel.project_dir%/public/uploads'
     public_prefix: '/uploads'
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

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 ~165 days

Recently: every ~247 days

Total

7

Last Release

1768d ago

PHP version history (2 changes)0.1.0PHP ^7.1.3

0.4.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

---

Top Contributors

[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (41 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/happyr-wordpress-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[pentatrion/vite-bundle

Vite integration for your Symfony app

2755.3M13](/packages/pentatrion-vite-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

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