PHPackages                             alleyinteractive/wp-block-audit-command - 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. alleyinteractive/wp-block-audit-command

ActiveWp-cli-package[Utility &amp; Helpers](/categories/utility)

alleyinteractive/wp-block-audit-command
=======================================

Audit WordPress block usage in post content.

v2.0.5(3mo ago)7313.0k↓22%[1 issues](https://github.com/alleyinteractive/wp-block-audit-command/issues)GPL-2.0-or-laterPHPPHP ^8.2

Since Feb 29Pushed 3mo ago18 watchersCompare

[ Source](https://github.com/alleyinteractive/wp-block-audit-command)[ Packagist](https://packagist.org/packages/alleyinteractive/wp-block-audit-command)[ Docs](https://github.com/alleyinteractive/wp-block-audit-command)[ RSS](/packages/alleyinteractive-wp-block-audit-command/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (9)Dependencies (22)Versions (14)Used By (0)

Block Audit Command
===================

[](#block-audit-command)

This is a WP-CLI package for auditing block usage in post content, which can help decide which blocks to prioritize before a content migration or redesign.

Quick links: [Using](#using) | [Installing](#installing) | [About](#about)

Using
-----

[](#using)

This package implements the following commands:

### wp block-audit run

[](#wp-block-audit-run)

Report how many of each type of block there is in post content and aggregated details about them.

The report includes the number of times each block is used, the post types it's used in, and details comprising:

- For all blocks, the count of 'align' attribute values.
- For 'core/heading' blocks, the count of each heading level used.
- For 'core/embed' blocks, the count of each embed provider used.

You can add more details to the report with the `alley_block_audit_block_type_details` and `alley_block_audit_{$block_name}_block_type_details` filters:

```
add_filter(
	'alley_block_audit_block_type_details',
	function ( $details, $block_name, $attrs, $inner_html, $block, $post ) {
		if ( isset( $attrs['fontSize'] ) && is_string( $attrs['fontSize'] ) ) {
			$details['fontSize'][ $attrs['fontSize'] ] ??= 0;
			$details['fontSize'][ $attrs['fontSize'] ]++;
		}

		return $details;
	},
	10,
	6,
);

add_filter(
	'alley_block_audit_core/image_block_type_details',
	function ( $details, $block_name, $attrs, $inner_html, $block, $post ) {
		if ( isset( $attrs['aspectRatio'] ) && is_string( $attrs['aspectRatio'] ) ) {
			$details['aspectRatio'][ $attrs['aspectRatio'] ] ??= 0;
			$details['aspectRatio'][ $attrs['aspectRatio'] ]++;
		}

		return $details;
	},
	10,
	6,
);
```

```
wp block-audit run  [--=] [--format=] [--progress-bar]

```

**OPTIONS**

```
[--=]
    One or more args to pass to WP_Query except for 'order', 'orderby', or 'paged'.

[--format=]
    Render output in a particular format.
    ---
    default: table
    options:
    - table
    - csv
    - json
    - count
    - yaml
    ---

[--progress-bar]
    Show the progress bar.

[--rewind]
    Resets the cursor so the next time the command is run it will start from the beginning.

```

**EXAMPLES**

```
$ wp block-audit run --post_type=post,page
+-----------------------------------+-------+------------------------------------------------------------+-----------------+----------------------------------------------------------------------+
| Block Name                        | Count | Example URL                                                | Post Types      | Details                                                              |
+-----------------------------------+-------+------------------------------------------------------------+-----------------+----------------------------------------------------------------------+
| core/archives                     | 3     | https://www.example.com/2023/01/13/widgets-block-category/ | ["post"]        |                                                                      |
| core/button                       | 12    | https://www.example.com/2023/01/13/design-category-blocks/ | ["post"]        | {"align":{"left":2,"center":1,"right":1}}                            |
| core/code                         | 2     | https://www.example.com/2023/01/13/text-category-blocks/   | ["post"]        |                                                                      |
| core/column                       | 40    | https://www.example.com/2023/01/13/design-category-blocks/ | ["post"]        |                                                                      |
| core/columns                      | 13    | https://www.example.com/2023/01/13/design-category-blocks/ | ["post"]        | {"align":{"wide":2,"full":1}}                                        |
| core/cover                        | 21    | https://www.example.com/2023/01/13/media-category-blocks/  | ["post"]        | {"align":{"left":1,"center":2,"full":1,"wide":2}}                    |
| core/file                         | 3     | https://www.example.com/2023/01/13/media-category-blocks/  | ["post"]        |                                                                      |
| core/gallery                      | 10    | https://www.example.com/2023/01/13/media-category-blocks/  | ["post"]        |                                                                      |
| core/group                        | 25    | https://www.example.com/2023/01/13/design-category-blocks/ | ["post"]        |                                                                      |
| core/heading                      | 23    | https://www.example.com/2023/01/13/text-category-blocks/   | ["post","page"] | {"H1":2,"H2":11,"H3":4,"H4":2,"H5":2,"H6":2}                         |
| core/html                         | 2     | https://www.example.com/2023/01/13/widgets-block-category/ | ["post"]        |                                                                      |
| core/image                        | 19    | https://www.example.com/2023/01/13/media-category-blocks/  | ["post"]        | {"align":{"center":2,"left":2,"right":3,"none":1,"wide":1,"full":1}} |
| core/list                         | 9     | https://www.example.com/2023/01/13/text-category-blocks/   | ["post"]        |                                                                      |
| core/list-item                    | 6     | https://www.example.com/2023/01/13/text-category-blocks/   | ["post"]        |                                                                      |
| core/media-text                   | 6     | https://www.example.com/2023/01/13/media-category-blocks/  | ["post"]        | {"align":{"full":1}}                                                 |
| core/paragraph                    | 262   | https://www.example.com/2023/01/13/text-category-blocks/   | ["post","page"] | {"align":{"center":16,"right":1,"left":1}}                           |
| core/pullquote                    | 4     | https://www.example.com/2023/01/13/text-category-blocks/   | ["post"]        |                                                                      |
| core/spacer                       | 4     | https://www.example.com/2023/01/13/design-category-blocks/ | ["post"]        |                                                                      |
| core/table                        | 4     | https://www.example.com/2023/01/13/text-category-blocks/   | ["post"]        |                                                                      |
+-----------------------------------+-------+---------------------------------------------------------------+-----------------+----------------------------------------------------------------------+

```

Installing
----------

[](#installing)

Installing this package requires WP-CLI v1.3.0 or greater. Update to the latest stable release with `wp cli update`.

Once you've done so, you can install the latest stable version of this package with:

```
wp package install alleyinteractive/wp-block-audit-command:@stable
```

You can also install this package with Composer:

```
composer require alleyinteractive/wp-block-audit-command
```

About
-----

[](#about)

### License

[](#license)

[GPL-2.0-or-later](https://github.com/alleyinteractive/wp-type-extensions/blob/main/LICENSE)

### Maintainers

[](#maintainers)

[Alley Interactive](https://github.com/alleyinteractive)

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance77

Regular maintenance activity

Popularity41

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~93 days

Recently: every ~108 days

Total

9

Last Release

108d ago

Major Versions

v1.2.0 → v2.0.02024-11-01

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2679da8ee30c4d7eae16ffd2271484027b3b27be6d7fb8202d5e4c6d210881d?d=identicon)[alleyinteractive](/maintainers/alleyinteractive)

---

Top Contributors

[![dlh01](https://avatars.githubusercontent.com/u/697432?v=4)](https://github.com/dlh01 "dlh01 (20 commits)")[![renatonascalves](https://avatars.githubusercontent.com/u/19148962?v=4)](https://github.com/renatonascalves "renatonascalves (16 commits)")[![attackant](https://avatars.githubusercontent.com/u/4309872?v=4)](https://github.com/attackant "attackant (4 commits)")

---

Tags

wordpresswordpress-package

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alleyinteractive-wp-block-audit-command/health.svg)

```
[![Health](https://phpackages.com/badges/alleyinteractive-wp-block-audit-command/health.svg)](https://phpackages.com/packages/alleyinteractive-wp-block-audit-command)
```

###  Alternatives

[alleyinteractive/wp-alleyvate

Defaults for WordPress sites by Alley.

3442.6k](/packages/alleyinteractive-wp-alleyvate)[alleyinteractive/wp-curate

Plugin to curate homepages and other landing pages

11234.6k](/packages/alleyinteractive-wp-curate)[alleyinteractive/wp-block-converter

Convert HTML into Gutenberg Blocks with PHP

65422.1k2](/packages/alleyinteractive-wp-block-converter)[alleyinteractive/mantle-framework

A framework for powerful WordPress development

28325.2k2](/packages/alleyinteractive-mantle-framework)[alleyinteractive/wp-bulk-task

A library to assist with running performant bulk tasks against WordPress objects.

21425.7k5](/packages/alleyinteractive-wp-bulk-task)[alleyinteractive/feed-consumer

Ingest external feeds and other data sources into WordPress

116.3k](/packages/alleyinteractive-feed-consumer)

PHPackages © 2026

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