PHPackages                             maximeculea/gutenberg-patterns-sync - 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. maximeculea/gutenberg-patterns-sync

ActiveWordpress-muplugin[Utility &amp; Helpers](/categories/utility)

maximeculea/gutenberg-patterns-sync
===================================

WP-CLI commands to export/import block patterns (wp\_block).

1.1.0(7mo ago)17GPL-3.0+PHPPHP &gt;=7.4

Since Aug 27Pushed 7mo agoCompare

[ Source](https://github.com/MaximeCulea/gutenberg-patterns-sync)[ Packagist](https://packagist.org/packages/maximeculea/gutenberg-patterns-sync)[ RSS](/packages/maximeculea-gutenberg-patterns-sync/feed)WikiDiscussions main Synced 1mo ago

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

Gutenberg Patterns Sync (Export/Import)
=======================================

[](#gutenberg-patterns-sync-exportimport)

Dev‑oriented plugin to sync patterns from local with other environments (staging, production) by exporting and importing block patterns (wp\_block) as JSON via WP‑CLI.

By default, stores these JSON files in the current theme's patterns/blocks-sync directory. It checks existing patterns to handle create/updates instead of hard‑deleting each time, which helps keep references in the DB and code stable.

Also, for each pattern, it keeps synced (or not) status, block categories.

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

[](#requirements)

- WordPress 6.0+
- PHP 7.4+
- WP-CLI available in the environment

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

[](#installation)

### As a regular plugin

[](#as-a-regular-plugin)

This package is a regular WordPress plugin. You can install and activate it like any other plugin.

- Copy this folder into `wp-content/plugins/gutenberg-patterns-sync` on your site.
- In WP Admin → Plugins, activate “Gutenberg Patterns Sync”.

### Via Composer (as MU‑plugin)

[](#via-composer-as-muplugin)

You can install by Composer, it is designed to be installed as a MU plugin under `wp-content/mu-plugins/` (developer‑oriented).

#### From Packagist

[](#from-packagist)

Do `composer require maximeculea/gutenberg-patterns-sync`

#### From Github

[](#from-github)

- Add into your composer.json `{ "type": "vcs", "url": "https://github.com/MaximeCulea/gutenberg-patterns-sync" }`
- Include `"maximeculea/gutenberg-patterns-sync": "dev-master"` in your composer file as require
- Before use, launch `composer update`

Commands
--------

[](#commands)

- `wp patterns export` — Export all published patterns (`wp_block` posts) to JSON files.
- `wp patterns import` — Import patterns (`wp_block` posts) from JSON files and optionally delete missing ones.

### Export

[](#export)

```
wp patterns export [--dir=] [--no-pretty] [--prefix=]

```

Options:

- `--dir=`: Destination directory. Default is current theme: `/patterns/blocks-sync`.
- `--no-pretty`: Disable pretty-printed JSON (pretty-print is enabled by default).
- `--prefix=`: Prefix for the `slug` field inside JSON (e.g. `mytheme`). Defaults to the active theme textdomain.

Output files are named `.json` and contain:

```
{
  "title": "...",
  "slug": "/",
  "content": "...",
  "categories": ["..."],
  "syncStatus": "synced" | "unsynced"
}

```

### Import

[](#import)

```
wp patterns import [--dir=] [--dry-run] [--no-verbose]

```

Options:

- `--dir=`: Source directory. Default is current theme: `/patterns/blocks-sync`.
- `--dry-run`: Show actions without applying changes.
- `--no-verbose`: Reduce log noise.

Behavior:

- Creates or updates by slug.
- Assigns `wp_pattern_category` terms (creates them if missing).
- Preserves sync status (`wp_pattern_sync_status` post meta).
- Deletes existing `wp_block` posts not present in the source directory (unless `--dry-run` is used).

License
-------

[](#license)

© Maxime Culea. Gutenberg Patterns Sync is licensed under GPL-3.0+.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance62

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Every ~26 days

Total

2

Last Release

237d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c2bcdef25746403cb03bda15e8ae70e1df551e01a039ad329709b5446b95bab?d=identicon)[MaximeCulea](/maintainers/MaximeCulea)

---

Top Contributors

[![MaximeCulea](https://avatars.githubusercontent.com/u/5576409?v=4)](https://github.com/MaximeCulea "MaximeCulea (5 commits)")

---

Tags

gutenberggutenberg-patternswordpresswordpress-developmentwp-cliwpcli

### Embed Badge

![Health badge](/badges/maximeculea-gutenberg-patterns-sync/health.svg)

```
[![Health](https://phpackages.com/badges/maximeculea-gutenberg-patterns-sync/health.svg)](https://phpackages.com/packages/maximeculea-gutenberg-patterns-sync)
```

###  Alternatives

[hyperf/engine-swow

Coroutine engine provided by swow.

1642.9k7](/packages/hyperf-engine-swow)

PHPackages © 2026

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