How to remove all plugins, posts, pages, and inactive themes in one line with wp-cli? WordPress bloatware removal

Softaculous seems to always adds junk to the installs I don't want. Such as example posts, pages, plugins, and starter themes. How do I remove them all for a fresh start?

Topic command-line php linux Wordpress

Category Web


I'd love any improvements, or hopefully this helps someone.

wp post delete $(wp post list --post_type='post' --format=ids);wp post delete $(wp post list --post_type='page' --format=ids);wp plugin delete --all;wp theme delete $(wp theme list --status=inactive --field=name);wp widget delete $(wp widget list sidebar-1 --fields=id);wp widget delete $(wp widget list sidebar-2 --fields=id)

edit: added removal of default widgets in sidebar, all seems to work now!

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.