Skip to content

WP-CLI Command: wp block type stats #213

@TeemuSuoranta

Description

@TeemuSuoranta

This command would search through posts and list all blocks that are used in any post.

These would result into table with block name and amount of uses.

Also returning example pages where block is used would be useful.

Base command:

wp block type stats

You should be also able to limit post type:

wp block type stats --post-type=page

The command wp post list includes example implementation of passing query arguments, return fields and format so it's good benchmark for this.

Use case: Review what blocks are in use and what are not. Useful when migrating old blocks into new and making sure obsolete blocks are safe to be removed.

This is complementary for #212 but both are useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions