We launched the multi-tenant WordPress Marketplace! 🎉

Licensing Admin Menu Editor


When creating your product, you’ll quickly find that you might not want your customers to perform certain actions in WordPress. You might have some plugins that need to remain activated, or should not be activated without the customer paying for the additional functionality. In order to limit your customer’s rights, you can use WordPress’ role system.

A great plugin to manage the role system is Admin Menu Editor Pro. It is, however, a paid plugin, meaning you’ll have to activate its license on every new domain you want to use it on. The plugin does allow you to license itself via the Admin panel in WordPress, but this is not a feasible endeavour if you’re using WPCS to automate your customers’ websites.

So, let’s automate the licensing of the Admin Menu Editor plugin using Tenant Lifecycle Hooks!


  1. The Admin Menu Editor Pro plugin should be installed and activated in the Version you are working in.
  2. To utilize the Tenant Lifecycle Hooks, we’ll use the Code Snippets plugin. So make sure you install that as well.
  3. In order to license the Admin Menu Editor Pro plugin, you’ll of course need a license for it. Check out Admin Menu Editor Pro to see how to obtain one.

Adding the PHP snippet

Now, with all required plugins snugly installed and activated, stay in the Version and add a PHP snippet with the following code, filling in your license key:

add_action('wpcs_tenant_created', 'activate_license_ame_plugin');

function activate_license_ame_plugin()
    $licenseManager = $GLOBALS['ameProLicenseManager'];

Make sure you select Run snippet everywhere in the snippet screen!


Due to the PHP snippets plugin storing snippets in the database, updating the snippets and redeploying will only affect newly created tenants. If you need older tenants to also be updated, you should run these snippets from either a custom plugin or from your theme’s functions.php file.

Testing the hook

When you now create a new tenant based on the Snapshot you’ve just deployed, you should find the Admin Menu Editor is licensed and ready to go!

Build a low code SaaS today

Start a 30-day free trial – Cancel anytime

Plugin name




Let’s automate the licensing of the Admin Menu Editor plugin using Tenant Lifecycle Hooks!

Code Snippet