I knew that one of my clients web sites is running an older version of WordPress. When I upgrade WordPress I like to know exactly what version is running so I can use something like WinMerge to compare every single file in the WordPress installation to verify specifically what is going to be upgraded. This is useful if you run into any problems you can attempt to only roll back specific files to see if it resolves the WordPress upgrade issue.
WordPress Version Not Showing In WP-Admin Footer:
Typically I look in the footer of the WordPress web administration section which typically lists the current version of WordPress is running. The issue is that if a new version is available instead of listing the current WordPress version it lists a link to the new WordPress download as shown in the below example.
So in the case where a new WordPress version is available for download how do you figure out what the current version of WordPress that is running for your web site? There are actually three different ways to display the WordPress version one of which is looking at the footer as noted above which obviously in this case did not work. The other two options are noted below.
Obtain WordPress Version From The version.php File On Your Server:
The easiest and most consistent way to obtain the WordPress version that is powering your WP site is to open the version.php file located in the path below. Please note that the below assumes that you are in the WordPress installations root directory.
WordPress version.php File Path:
- /wp-includes/version.php
Example WordPress version.php File:
- <?php
- /**
- * This holds the version number in a separate file so we can bump it without cluttering the SVN
- */
- /**
- * The WordPress version string
- *
- * @global string $wp_version
- */
- $wp_version = '2.8.6';
- /**
- * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
- *
- * @global int $wp_db_version
- */
- $wp_db_version = 11548;
- /**
- * Holds the TinyMCE version
- *
- * @global string $tinymce_version
- */
- $tinymce_version = '3241-1141';
- /**
- * Holds the cache manifest version
- *
- * @global string $manifest_version
- */
- $manifest_version = '20090616';
As you can see in the example version.php file above the WordPress version is noted on line 11. So in the example the WordPress version powering the example site is WordPress version 2.8.6 which is currently fairly far behind the current WordPress version of 2.9.2 at the time of writing this article.
PHP Code To Print WordPress Version At Any Location:
- <?php
- bloginfo('version');
- ?>
The above code will simply print out the version such as “3.0-alpha” or something similar. The code must be added to a PHP page that loads the necessary WordPress framework such as a plugin or another WP-Admin page that already exists.