diff --git a/core/lib/Drupal/Core/Session/AccountInterface.php b/core/lib/Drupal/Core/Session/AccountInterface.php
index 36b390a..76cffbf 100644
--- a/core/lib/Drupal/Core/Session/AccountInterface.php
+++ b/core/lib/Drupal/Core/Session/AccountInterface.php
@@ -137,11 +137,7 @@ public function getAccountName();
    * Returns the display name of this account.
    *
    * By default, the passed-in object's 'name' property is used if it exists, or
-   * else, the site-defined value for the 'anonymous' variable. However, a
-   * module may override this by implementing
-   * hook_user_format_name_alter(&$name, $account).
-   *
-   * @see hook_user_format_name_alter()
+   * else, the site-defined value for the 'anonymous' variable.
    *
    * @return string|\Drupal\Component\Utility\SafeStringInterface
    *   Either a string that will be auto-escaped on output or a
diff --git a/core/lib/Drupal/Core/Session/UserSession.php b/core/lib/Drupal/Core/Session/UserSession.php
index 55f4938..4664bac 100644
--- a/core/lib/Drupal/Core/Session/UserSession.php
+++ b/core/lib/Drupal/Core/Session/UserSession.php
@@ -175,7 +175,6 @@ public function getAccountName() {
    */
   public function getDisplayName() {
     $name = $this->name ?: \Drupal::config('user.settings')->get('anonymous');
-    \Drupal::moduleHandler()->alter('user_format_name', $name, $this);
     return $name;
   }
 
diff --git a/core/modules/comment/src/Tests/CommentPreviewTest.php b/core/modules/comment/src/Tests/CommentPreviewTest.php
index 2a9b197..cd3ce20 100644
--- a/core/modules/comment/src/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/src/Tests/CommentPreviewTest.php
@@ -43,20 +43,9 @@ function testCommentPreview() {
     // Login as web user.
     $this->drupalLogin($this->webUser);
 
-    // Test escaping of the username on the preview form.
-    \Drupal::service('module_installer')->install(['user_hooks_test']);
-    \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
     $edit = array();
     $edit['subject[0][value]'] = $this->randomMachineName(8);
     $edit['comment_body[0][value]'] = $this->randomMachineName(16);
-    $this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview'));
-    $this->assertEscaped('<em>' . $this->webUser->id() . '</em>');
-
-    \Drupal::state()->set('user_hooks_test_user_format_name_alter_safe', TRUE);
-    $this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview'));
-    $this->assertTrue(SafeMarkup::isSafe($this->webUser->getDisplayName()), 'Username is marked safe');
-    $this->assertNoEscaped('<em>' . $this->webUser->id() . '</em>');
-    $this->assertRaw('<em>' . $this->webUser->id() . '</em>');
 
     // Add a user picture.
     $image = current($this->drupalGetTestFiles('image'));
diff --git a/core/modules/tracker/src/Tests/TrackerTest.php b/core/modules/tracker/src/Tests/TrackerTest.php
index 425c4a1..9a1f084 100644
--- a/core/modules/tracker/src/Tests/TrackerTest.php
+++ b/core/modules/tracker/src/Tests/TrackerTest.php
@@ -210,19 +210,6 @@ function testTrackerUser() {
     $this->drupalPostForm('comment/1/edit', array('status' => CommentInterface::NOT_PUBLISHED), t('Save'));
     $this->drupalGet('user/' . $this->user->id() . '/activity');
     $this->assertNoText($other_published_my_comment->label(), 'Unpublished comments are not counted on the tracker listing.');
-
-    // Test escaping of title on user's tracker tab.
-    \Drupal::service('module_installer')->install(['user_hooks_test']);
-    Cache::invalidateTags(['rendered']);
-    \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
-    $this->drupalGet('user/' . $this->user->id() . '/activity');
-    $this->assertEscaped('<em>' . $this->user->id() . '</em>');
-
-    \Drupal::state()->set('user_hooks_test_user_format_name_alter_safe', TRUE);
-    Cache::invalidateTags(['rendered']);
-    $this->drupalGet('user/' . $this->user->id() . '/activity');
-    $this->assertNoEscaped('<em>' . $this->user->id() . '</em>');
-    $this->assertRaw('<em>' . $this->user->id() . '</em>');
   }
 
   /**
diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php
index 781061a..cdcf42e 100644
--- a/core/modules/user/src/Entity/User.php
+++ b/core/modules/user/src/Entity/User.php
@@ -377,7 +377,6 @@ public function getAccountName() {
    */
   public function getDisplayName() {
     $name = $this->getAccountName() ?: \Drupal::config('user.settings')->get('anonymous');
-    \Drupal::moduleHandler()->alter('user_format_name', $name, $this);
     return $name;
   }
 
diff --git a/core/modules/user/src/Tests/UserEntityCallbacksTest.php b/core/modules/user/src/Tests/UserEntityCallbacksTest.php
index ce7726a..6fc9ae9 100644
--- a/core/modules/user/src/Tests/UserEntityCallbacksTest.php
+++ b/core/modules/user/src/Tests/UserEntityCallbacksTest.php
@@ -22,7 +22,7 @@ class UserEntityCallbacksTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('user', 'user_hooks_test');
+  public static $modules = array('user');
 
   /**
    * An authenticated user to use for testing.
@@ -57,11 +57,6 @@ function testLabelCallback() {
     $this->assertEqual($this->anonymous->label(), $name, 'The variable anonymous should be used for name of uid 0');
     $this->assertEqual($this->anonymous->getDisplayName(), $name, 'The variable anonymous should be used for display name of uid 0');
     $this->assertEqual($this->anonymous->getUserName(), '', 'The raw anonymous user name should be empty string');
-
-    // Set to test the altered username.
-    \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
-
-    $this->assertEqual($this->account->getDisplayName(), '<em>' . $this->account->id() . '</em>', 'The user display name should be altered.');
     $this->assertEqual($this->account->getUsername(), $this->account->name->value, 'The user name should not be altered.');
   }
 
diff --git a/core/modules/user/src/Tests/UserTokenReplaceTest.php b/core/modules/user/src/Tests/UserTokenReplaceTest.php
index ad5d296..8ec04b9 100644
--- a/core/modules/user/src/Tests/UserTokenReplaceTest.php
+++ b/core/modules/user/src/Tests/UserTokenReplaceTest.php
@@ -26,7 +26,7 @@ class UserTokenReplaceTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('language', 'user_hooks_test');
+  public static $modules = array('language');
 
   /**
    * {@inheritdoc}
@@ -47,8 +47,6 @@ function testUserTokenReplacement() {
       'language' => $language_interface,
     );
 
-    \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
-
     // Create two users and log them in one after another.
     $user1 = $this->drupalCreateUser(array());
     $user2 = $this->drupalCreateUser(array());
diff --git a/core/modules/user/tests/modules/user_hooks_test/user_hooks_test.info.yml b/core/modules/user/tests/modules/user_hooks_test/user_hooks_test.info.yml
deleted file mode 100644
index 2e56f17..0000000
--- a/core/modules/user/tests/modules/user_hooks_test/user_hooks_test.info.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-name: 'User module hooks tests'
-type: module
-description: 'Support module for user hooks testing.'
-package: Testing
-version: VERSION
-core: 8.x
diff --git a/core/modules/user/tests/modules/user_hooks_test/user_hooks_test.module b/core/modules/user/tests/modules/user_hooks_test/user_hooks_test.module
deleted file mode 100644
index a036c65..0000000
--- a/core/modules/user/tests/modules/user_hooks_test/user_hooks_test.module
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
- * @file
- * Support module for user hooks testing.
- */
-
-use Drupal\Component\Utility\SafeMarkup;
-
-/**
- * Implements hook_user_format_name_alter().
- */
-function user_hooks_test_user_format_name_alter(&$name, $account) {
-  if (\Drupal::state()->get('user_hooks_test_user_format_name_alter', FALSE)) {
-    if (\Drupal::state()->get('user_hooks_test_user_format_name_alter_safe', FALSE)) {
-      $name = SafeMarkup::format('<em>@uid</em>', array('@uid' => $account->id()));
-    }
-    else {
-      $name = '<em>' . $account->id() . '</em>';
-    }
-  }
-}
diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index 26e7f5a..d912507 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -105,28 +105,6 @@ function hook_user_cancel_methods_alter(&$methods) {
 }
 
 /**
- * Alter the username that is displayed for a user.
- *
- * Called by $account->getDisplayName() to allow modules to alter the username
- * that is displayed. Can be used to ensure user privacy in situations where
- * $account->name is too revealing.
- *
- * @param string $name
- *   The string that $account->getDisplayName() will return.
- *
- * @param $account
- *   The account object passed to user_format_name().
- *
- * @see $account->getDisplayName()
- */
-function hook_user_format_name_alter(&$name, $account) {
-  // Display the user's uid instead of name.
-  if ($account->id()) {
-    $name = t('User @uid', array('@uid' => $account->id()));
-  }
-}
-
-/**
  * The user just logged in.
  *
  * @param object $account
