使用WP-CLI,结合wp post list
和wp post delete
使用--force
跳过垃圾箱的选项如下:
# Delete all posts skipping trash
$ wp post delete $(wp post list --post_type=\'post\' --format=ids) --force
其他示例:
# Delete post skipping trash
$ wp post delete 123 --force
Success: Deleted post 123.
# Delete all pages
$ wp post delete $(wp post list --post_type=\'page\' --format=ids)
Success: Trashed post 1164.
Success: Trashed post 1186.
# Delete all posts in the trash
$ wp post delete $(wp post list --post_status=trash --format=ids)
Success: Deleted post 1268.
Success: Deleted post 1294.