MainWP Codex is a great place to learn how to extend the MainWP plugin creating custom extensions or simple customizations.

Actions & Filters

See all available hooks in the MainWP plugin that will allow you to add data or change how MainWP works.

Code Reference

Browse MainWP codebase to learn what’s going on inside the MainWP plugin core files.


The MainWP API uses REST conventions and returns all data in JSON format. Requests may be made using the HTTPS protocol and must be authenticated using a Consumer Key and Consumer Secret. The API supports 3 primary resources, each with a related set of endpoints: Response bodies from the MainWP API are in JSON format, with a Content-Type: of application/json and UTF-8 character encoding.

Initialising your own plugin

The function “activate_this_plugin” is called when the main is initialized. Since extensions may be enabled and disabled in our extension section we have to check if this particular plugin is enabled.

This is done with the ‘mainwp_extension_enabled_check’ hook. If the plugin is not enabled this will return false, if the plugin is enabled, an array will be returned containing a key. This key is used for some data requests to our main. (You will find more about this in the filters using this key)