WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Easy question. Where does the self-hosted WordPress store version information?

share|improve this question
up vote 16 down vote accepted

If you need to get the wordpress version in your script, there is a global variable:

$wp_version (right now it's something like '3.1-RC3-17376')

It contains the wordpress version.

If you need to acquire if from a file, you can read it from /wp-includes/version.php:

function getWPVersion() {
    $path = '/path/to/wp-install';
    include $path.'/wp-includes/version.php';
    return $wp_version;

Wordpress Version Variables

There is more information available in that file:

  • $wp_version - The WordPress version string ('3.1-RC3-17376')
  • $wp_db_version - Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema (17056)
  • $tinymce_version - The TinyMCE version string ('3393')
  • $manifest_version - Holds the cache manifest version ('20111113')
  • $required_php_version - Holds the required PHP version ('4.3')
  • $required_mysql_version - Holds the required MySQL version ('4.1.2')
share|improve this answer

The codex says its in wp-includes/version.php.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.