diff --git a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
index fd4ab62..015f066 100644
--- a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
+++ b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
@@ -57,7 +57,7 @@ protected function getEntityCounts() {
       'search_page' => 2,
       'shortcut' => 2,
       'shortcut_set' => 1,
-      'action' => 22,
+      'action' => 14,
       'menu' => 8,
       'taxonomy_term' => 6,
       'taxonomy_vocabulary' => 6,
diff --git a/core/modules/user/src/RoleForm.php b/core/modules/user/src/RoleForm.php
index ada54dd..bf18327 100644
--- a/core/modules/user/src/RoleForm.php
+++ b/core/modules/user/src/RoleForm.php
@@ -58,6 +58,37 @@ public function save(array $form, FormStateInterface $form_state) {
     $entity->set('label', trim($entity->label()));
     $status = $entity->save();
 
+    // Create actions but ignore the authenticated and anonymous roles.
+    if (!in_array($entity->id(), array(RoleInterface::AUTHENTICATED_ID, RoleInterface::ANONYMOUS_ID))) {
+      $type_manager = $this->entityTypeManager->getStorage('action');
+      $add_id = 'user_add_role_action.' . $entity->id();
+      if (!$type_manager->load($add_id)) {
+        $action = $type_manager->create(array(
+          'id' => $add_id,
+          'type' => 'user',
+          'label' => $this->t('Add the @label role to the selected users', array('@label' => $entity->label())),
+          'configuration' => array(
+            'rid' => $entity->id(),
+          ),
+          'plugin' => 'user_add_role_action',
+        ));
+        $action->trustData()->save();
+      }
+      $remove_id = 'user_remove_role_action.' . $entity->id();
+      if (!$type_manager->load($remove_id)) {
+        $action = $type_manager->create(array(
+          'id' => $remove_id,
+          'type' => 'user',
+          'label' => $this->t('Remove the @label role from the selected users', array('@label' => $entity->label())),
+          'configuration' => array(
+            'rid' => $entity->id(),
+          ),
+          'plugin' => 'user_remove_role_action',
+        ));
+        $action->trustData()->save();
+      }
+    }
+
     $edit_link = $this->entity->link($this->t('Edit'));
     if ($status == SAVED_UPDATED) {
       drupal_set_message($this->t('Role %label has been updated.', array('%label' => $entity->label())));
diff --git a/core/modules/user/src/Tests/UserActionConfigSchemaTest.php b/core/modules/user/src/Tests/UserActionConfigSchemaTest.php
index 99c2df7..ffb5203 100644
--- a/core/modules/user/src/Tests/UserActionConfigSchemaTest.php
+++ b/core/modules/user/src/Tests/UserActionConfigSchemaTest.php
@@ -10,6 +10,7 @@
 use Drupal\config\Tests\SchemaCheckTestTrait;
 use Drupal\simpletest\KernelTestBase;
 use Drupal\user\Entity\Role;
+use Drupal\system\Entity\Action;
 
 /**
  * Ensures the user action for adding and removing roles have valid config
@@ -35,6 +36,28 @@ function testValidUserActionConfigSchema() {
     $rid = strtolower($this->randomMachineName(8));
     Role::create(array('id' => $rid))->save();
 
+    // Add actions.
+    $action = Action::create(array(
+      'id' => 'user_add_role_action.' . $rid,
+      'type' => 'user',
+      'label' => t('Add the @label role to the selected users', array('@label' => $rid)),
+      'configuration' => array(
+        'rid' => $rid,
+      ),
+      'plugin' => 'user_add_role_action',
+    ));
+    $action->trustData()->save();
+    $action = Action::create(array(
+      'id' => 'user_remove_role_action.' . $rid,
+      'type' => 'user',
+      'label' => t('Remove the @label role from the selected users', array('@label' => $rid)),
+      'configuration' => array(
+        'rid' => $rid,
+      ),
+      'plugin' => 'user_remove_role_action',
+    ));
+    $action->trustData()->save();
+
     // Test user_add_role_action configuration.
     $config = $this->config('system.action.user_add_role_action.' . $rid);
     $this->assertEqual($config->get('id'), 'user_add_role_action.' . $rid);
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 0e9cedb..4b14dd9 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -18,7 +18,6 @@
 use Drupal\Core\Session\AnonymousUserSession;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\Url;
-use Drupal\system\Entity\Action;
 use Drupal\user\Entity\Role;
 use Drupal\user\Entity\User;
 use Drupal\user\RoleInterface;
@@ -976,43 +975,6 @@ function user_role_names($membersonly = FALSE, $permission = NULL) {
 }
 
 /**
- * Implements hook_ENTITY_TYPE_insert() for user_role entities.
- */
-function user_user_role_insert(RoleInterface $role) {
-  // Ignore the authenticated and anonymous roles or the role is being synced.
-  if (in_array($role->id(), array(RoleInterface::AUTHENTICATED_ID, RoleInterface::ANONYMOUS_ID)) || $role->isSyncing()) {
-    return;
-  }
-
-  $add_id = 'user_add_role_action.' . $role->id();
-  if (!entity_load('action', $add_id)) {
-    $action = Action::create(array(
-      'id' => $add_id,
-      'type' => 'user',
-      'label' => t('Add the @label role to the selected users', array('@label' => $role->label())),
-      'configuration' => array(
-        'rid' => $role->id(),
-      ),
-      'plugin' => 'user_add_role_action',
-    ));
-    $action->trustData()->save();
-  }
-  $remove_id = 'user_remove_role_action.' . $role->id();
-  if (!entity_load('action', $remove_id)) {
-    $action = Action::create(array(
-      'id' => $remove_id,
-      'type' => 'user',
-      'label' => t('Remove the @label role from the selected users', array('@label' => $role->label())),
-      'configuration' => array(
-        'rid' => $role->id(),
-      ),
-      'plugin' => 'user_remove_role_action',
-    ));
-    $action->trustData()->save();
-  }
-}
-
-/**
  * Implements hook_ENTITY_TYPE_delete() for user_role entities.
  */
 function user_user_role_delete(RoleInterface $role) {
