Re-create DLM’s roles and capabilities

Sometimes your site can end up with messed up user roles and capabilities.

This could result in various actions denied, e.g. API calls even if you set up your credentials correctly. The following guide will provide detailed instructions on how to reset DLM’s roles and capabilities.

1. Add snippet

Add the following code in wp-content/mu-plugins/dlm-temporary.php file.

Note: If mu-plugins directory doesn’t exists, create it.

add_action('plugins_loaded', function(){
	if(isset($_GET['dlm_recreate_roles'])) {
		die('Roles recreated');

Files in this directory are autoloaded after all plugins are initialized.

2. Trigger reset procedure

To trigger the reset process, visit your site with the following url:

If you see “Roles recreated” then it means that you should be able to see the user roles and capabilities in “User Role Manager” plugin interface. The DLM roles and caps all start with dlm_ prefix.

3. Remove snippet

To clean up after successful role/caps reset, simply remove the file that you added before: wp-content/mu-plugins/dlm-temporary.php

If you still need help, do not hesitate to contact us!