Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Add an `--all` flag to `wp comment delete`

Aberta
#538 2 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@shawnhooper já está trabalhando nisso.

Desde 15/10/2025.

  • #546 de @shawnhooper — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
php
Domínio
cli

Direção de pesquisa

Start at the wp comment delete entry point and compare its behavior with wp plugin delete --all, wp theme delete --all, and wp site empty. Clarify the confirmation and --yes requirements before implementing; done means wp comment delete --all removes all comments safely, with the intended non-interactive behavior covered by tests.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

command:comment-delete state:unconfirmed

Feature Request

Describe your use case and the problem you are facing

A website under my purview had hundreds of thousands of spam comments. It would be nice to be able to remove them in one fell swoop without having to resort to database queries (truncate wp_comments; truncate wp_commentmeta;).

Describe the solution you'd like

I'd like to add a flag to the wp comment delete subcommand:

wp comment delete --all

This may have a confirmation prompt along the lines of "Are you sure you want to delete XXXXX comments? (Y/n)" There might also be a "--yes" option for non-interactive use:

wp comment delete --all --yes

The addition of the "--all" flag would mirror similar-ish flags for the wp plugin delete --all and wp theme delete --all commands.

I'm aware that the wp site empty command also removes all comments, but this is a little bit different.

I'd be happy to take a stab at adding this modification, if approved.

Linguagem predominante
PHP
Estrelas
105
Forks
97
Merge médio
1h 17min
PRs com merge (30d)
6

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de wp-cli/entity-command

Todas as issues de wp-cli/entity-command

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.