KNOWNHOST KNOWLEDGE BASE

Hosting Question? Find the Solution - Browse our Guides, Articles, and How-To's

How To Find CMS Version of WordPress, Joomla, and Drupal?

Requirements: SSH / Terminal Knowledge

A key role of server maintenance is ensuring that all Content Management Systems (CMS) installed are kept up to date. For some, this can be quite a challenge. Having just a few installs can make it quite a task to check if all installs are up to date. We’ve got a few one-liners that should make this task a lot easier. Throw a cron job in the mix and it takes almost all of the work out of it!

Performing the functions listed here require that you are logged in as root or a sudo user via SSH and are familiar with the command line.

Checking WordPress Versions

To confirm the ‘latest’ stable release of WordPress you can visit their official WordPress Download page. You should see something similar to: “The latest stable release of WordPress (Version X.X) is available in two formats from the links to your right.” X.X being the latest version.

Ok, now for the fun. “How do I know the versions of ALL my wordpress installs?

  • Default cPanel configurations:
  find /home/*/public_html/ -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \;
  • Default Plesk configurations:
  find /var/www/vhosts/*/httpdocs -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \;

You’ll see output similar to the following:

  /home/cpanelacc/public_html/wp-includes/version.php:$wp_version = '3.9.2';
  /home/cpanelacc2/public_html/blog/wp-includes/version.php:$wp_version = '3.5.1';
  /home/cpanelacc3/public_html/blog/wp-includes/version.php:$wp_version = '3.7.4';
  /home/cpanelaccetc/public_html/wp-includes/version.php:$wp_version = '3.6';

This shows the location of the WordPress installation. /home/<CPANELUSER>/public_html/path and the version that’s installed in that location.

If any of your WordPress installations are not using the most recent version of WordPress, it is very important to update it.

Checking Joomla! CMS Version

To confirm the ‘latest’ stable release of Joomla! you can visit their official Joomla! Download page. You should see something similar to: “Joomla X.X is the newest version recommended for new installs. It includes the latest and greatest features of Joomla and mobile/responsive support.” X.X being the latest version.

Joomla has varied where it stores it’s version information depending on it’s major release – you may need to alter the find command with the paths provided in the Other Ways sections in Joomla’s Documentation.

For example, Joomla 3.8.x and greater will be in ./libraries/src/Version.php .

  • Default cPanel configurations:
  find /home/*/public_html/ -type f \( -iwholename '*/libraries/joomla/version.php' -o -iwholename '*/libraries/cms/version.php' -o -iwholename '*/libraries/cms/version/version.php' \) -print0 -exec perl -e 'while (<>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq( = $release.$dev\n);' {} \;
  • Default Plesk configurations:
  find /var/www/vhosts/*/httpdocs -type f \( -iwholename '*/libraries/joomla/version.php' -o -iwholename '*/libraries/cms/version.php' -o -iwholename '*/libraries/cms/version/version.php' \) -print0 -exec perl -e 'while (<>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq( = $release.$dev\n);' {} \;

You’ll see output similar to the following:

  /home/cpanelacc/public_html/libraries/joomla/version.php = 1.5.2
  /home/user1/public_html/portal/libraries/cms/version/version.php = 2.5.5
  /home/another3/public_html/libraries/cms/version/version.php = 2.5.8
  /home/example/public_html/portal/libraries/joomla/version.php = 1.5.23
  /home/default/public_html/new2/libraries/joomla/version.php = 1.5.23

This shows the location of the Joomla! installation. /home/<CPANELUSER>/public_html/path and the version that’s installed in that location.

Checking Drupal CMS Version

To confirm the ‘latest’ stable release of Drupal you can visit their official Drupal Download page. You should see something similar to this screen shot sample:

cms version

The “Recommended releases” section has two versions which are both considered the latest stable CMS version. 7.31 and 6.33 are both adequate here.

  • Default cPanel configurations:
  find /home/*/public_html/ -type f -iwholename "*/modules/system/system.info" -exec grep -H "version = \"" {} \;
  • Default Plesk configurations:
  find /var/www/vhosts/*/httpdocs -type f -iwholename "*/modules/system/system.info" -exec grep -H "version = \"" {} \;

You’ll see ouput similar to the following:

  /home/baladon/public_html/modules/system/system.info:version = "7.9"
  /home/flaviosp/public_html/openatrium/modules/system/system.info:version = "6.28"
  /home/ioclaser/public_html/modules/system/system.info:version = "6.28"
  /home/tamiresm/public_html/modules/system/system.info:version = "7.10"

This shows the location of the Drupal installation. /home/<CPANELUSER>/public_html/path and the CMS version that’s installed in that location.