最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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?

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?

Share Improve this question edited Feb 12, 2020 at 21:43 Subtopic asked Feb 11, 2020 at 0:39 SubtopicSubtopic 114 bronze badges 1
  • Or... Don't use Softaculous :) – RiddleMeThis Commented Feb 12, 2020 at 21:52
Add a comment  | 

1 Answer 1

Reset to default 0

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!

发布评论

评论列表(0)

  1. 暂无评论