Skip to content

Please add options to delete pages to WP CLI #568

Closed as not planned
Closed as not planned

Description

@josvlaar

I don't understand why posts can be deleted through WP CLI but pages cannot. I want to automatically delete the sample pages on my client installs through a script.

Activity

  1. swissspidy commented on Jan 28, 2026

    @swissspidy
    Member

    A page in WordPress is just a different type of post. wp post delete works for any post type. So if you have a page with ID 123 you can run wp post delete 123

  2. josvlaar commented on Jan 30, 2026

    @josvlaar
    Author

    Thank you, that worked. I was sidetracked because wp post list would not show pages and their ID's... It probably should?

  3. swissspidy commented on Jan 30, 2026

    @swissspidy
    Member

    You can filter by post type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions