Hide WordPress Version From Dashboard Footer

By .     7 Comments

Hiding your WordPress installation version is a good idea. Knowing what version you’re running, a malicious person could take advantage of the vulnerabilities identified within that version and potentially corrupt, delete, or even control your WordPress installation and all your web host files. Why some theme developers decide to advertise the version within the <head> element and WordPress itself displays the version to everyone with an account inside the Dashboard (wp-admin) area is unknown to me.

In this tech tip, I’ll be showing you how to hide the version from non-Admins in the Dashboard footer.

Open up the /wp-admin/admin-footer.php with your favorite text editor (I prefer Notepad++). On line 25, locate:
<p id="footer-upgrade" class="alignright"><?php echo $upgrade; ?></p>

Replace that with:

<?php if ( is_super_admin() )
  echo '<p id="footer-upgrade" class="alignright">'. $upgrade .'</p>';
?>

You must use the is_super_admin() function instead of the is_admin() function. The former checks if the user is a network/super admin, while the latter checks if the user is viewing the Dashboard or administration panels (ie. any user who is logged in).

Core File! Since this tip is an adjustment to the WordPress core, you will need to adjust it after each update. Make a note of it with a link back here so you don’t forget.

Update: Functions hook

By XPS on July 16, 2012.

Although the above adjustment is rather small, it is an adjustment to the core system, so it will likely need to be applied after each WordPress automatic update. Fortunately, WordPress now uses “minimal updates,” which means only files that are modified in the newer version will be touched. Files that haven’t changed in the new version won’t any longer be replaced.

Even so, some people prefer to abstain from adjusting core files as much as possible. Thanks to functions.php files, you don’t need to. Either at the bottom of your /wp-content/themes/{YOUR THEME}/functions.php file or at the bottom of your “Functions Plugin” if you’re using one, add the following code:

/**
  * Hide WP version on dashboard's footer unless your User can update WP
  * Taken from https://www.computertechtips.net/85/hide-wordpress-version-from-dashboard-footer/
  */
if ( !function_exists('ctt_hideversionfooter') ) {
  function ctt_hideversionfooter($upgrade) {
    if ( !current_user_can('update_core')) {
      echo '';
    }
    else {
      return $upgrade;
    }
  }
  add_filter('update_footer', 'ctt_hideversionfooter', 100);
}

The difference between the code at the top and this hook is how they decide to show it. The update_core capability is one that a Super Admin has. So, they’re different in a specific sense, but they function just the same.

The number 100 at the end of the add_filter line specifies the priority that this adjustment should apply. A priority of 100 is certainly low enough to allow higher priority adjustments of the update_footer function to work.

Posted in: Web Development



is the site owner of Computer Tech Tips and is passionate about computer technology, particularly Windows-based software, malware removal, and web development. He enjoys helping people troubleshoot computer problems and providing technical support to family, friends, and people around the net. Xps wrote 78 article(s) for Computer Tech Tips.


 Subscribe to comments: this article | all articles

Comments (7)

  1. Joan says:

    One year later… There is no hook for this?

  2. XPS says:

    There you go Joan. I updated the article with a hook to add to your functions file/plugin. Hopefully it works out for you.

  3. Joan says:

    Very nice solution, thanks XPS!

  4. HRanjan says:

    Although this is a nice article but I have also created a very simple plugin to remove the version number as well as footer text from the admin dashboard.

    You can checkout it here Remove Admin Footer and Version

    Thanks,

  5. XPS says:

    Hi HRanjan. I’ve taken a look at your plugin and it is very similar. It seems a lot of people desire this ability.

    The difference between yours and mine is that yours will hide the version in the footer for everyone, plus it hides the “Thank you … WordPress.” I’m curious why you bothered to hide the thank you message. Aren’t you proud to use this open-source system?

  6. HRanjan says:

    Hi XPS,

    No its not like that, I am very proud of using opensource specially WordPress but this plugin I just made for those people who seek some sort of client branding before handing over website to the client.

    Thanks.

  7. XPS says:

    Okay, I gotcha. I recall seeing varying adjustments for that too like: “Thank you … WordPress and XYZ Company.” Good idea and nice place for branding.

Comments are automatically closed after a period of time to prevent SPAM.