Enhancement MainWP, remove non-mainwp actions through WP CLI

Hiya all,

I am using Cloudways Safeupdates to update our websites automatically. Due to this approach the Non-MainWP actions list fills up immensely over time.

I do not like to manually go over these lists to remove them as Cloudways Safeupdates assures correct updates. So I needed a way to remove them through a scheduled cronjob.

Thus I wrote a small MainWP CLI extension, please find the github below. I extended the class of MainWP CLI interface so it is in line with existing implementation.


  wp mainwp delete_actions

  remove non-mainwp actions from child sites

  wp mainwp delete_actions [<websiteid>] [--all]

    The id (or ids, comma separated) of the child sites that need to be synced.

    If set, non-mainwp actions from all child sites will be removed

    wp mainwp delete_action 2,5
    wp mainwp delete_action --all

Maybe this can be put in MainWP itself or at least be of use to someone else.



@opicron1 Thank you very much for posting this for the community to consume. We all love to see our users enjoying one of the best things about MainWP - it’s ability to be customized.

I have updated the Categories for this post so that it’s easier to be found by others in the future.


Absolutely, the main reason (see what I did there) of choosing MainWP is customizability and self hosting. Well worth the lifetime fee. Thanks to the devs and community making this awesome managing tool.

I am working on another awesome addition, an woocommerce product importer to be compatible with MainWP. It is a few months off due to polishing though.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.