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.

Adding your Extension

The “mainwp_getextensions” filter is used to add your extension to MainWP.


Where ‘plugin_get_extension’ is the function MainWP should call when the $extensions array is being retrieved. Note that the filter function must return an array of extensions after it is finished processing, or no extensions will be displayed, and other plugins also filtering the $extensions array may generate errors.

plugin_get_extension should be unique function name. It cannot match any other function name already declared.

Both examples use the following two actions to add the settings page header and footer: mainwp-pageheader-extensions and mainwp-pagefooter-extensions

Add an extension without authentication
The following example adds your extension to MainWP.

Add an extension with authentication
The following example adds your extension to MainWP.

Please not to add the authentication you need to implement an mechanism to fill up the $locked variable in the example above.