Find the version number of all WordPress installations on your Linux server.

I have a lot of customers running WordPress on our shared hosting servers, and sometimes they neglect to update their WordPress installs. [Rolls Eyes]

I need to know which of these sites are using an obsolete version of WordPress so I may contact the customer and warn them that they need to update their software.

So here’s a helpful little Linux command I whipped up and ran as root to go through my /home folder searching for all WordPress versions. I only had to run it as root because I am checking through all users’ folders, not just my own. If you only want to check your own user, you don’t need root access.

I ran this command from my /home folder on the Linux server:

find . -name 'version.php' -exec grep '$wp_version =' {} /dev/null \; > /tmp/wordpress-versions.log

Breakdown:

  • find . -name ‘version.php’
    Search through the current folder, recursively, for any file named version.php. This is where WordPress stores the WordPress version number.
  • -exec
    Execute a command with each found item.
  • grep ‘$wp_version =’ {}
    Look within the found version.php file(s) in a loop for the term $wp_version = and output the result.
  • /dev/null
    Trick grep into thinking there is a second file, forcing it to precede the output with the filename provided by find
  • \;
    Close the find command.
  • > /tmp/wordpress-versions.log
    Save the results to a log file in /tmp. You can tail -f this file while scanning, or simply open or cat it when you’re done. Leave this portion out of the command if you’d rather have it output directly to your screen.

4
Leave a Reply

avatar
3 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
4 Comment authors
128 bit encryption softwareapplock hideRobbie FergusonSteve Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
128 bit encryption software
Guest

Full disk encryption is encryption in the hard disk level. This software performs by automatically converting data on a hard drive into a form that can not be comprehended by everybody who doesn’t have the essential to “undo” the conversion. Without the correct authentication essential, even when the difficult hard drive is taken away and used in a different machine, the data remains inaccessible.

applock hide
Guest

Oh it’s right, File Encryption is the best encryption software to encrypt, lock and hide files, folders, drives in a convenient method. This encryption software is compatible with all popular versions of Windows OS

Steve
Guest
Steve

Thank you!

It’s working perfectly!