How to find Outdated Versions of WordPress on cPanel / Plesk Server : One of the main factors to consider for proper server maintenance is ensuring that Content Management Systems (CMS) are up to date.

In the case of WordPress, they roll out regular updates and security patches to protect the websites that use them, but some clients fail to keep their CMS up to date and this calls in for a security bleak.

A hacked or compromised website not only cause problems for the client who got hacked but it also affects all the clients on the server, as the hacker or the malicious entity is usually going to send out spam from the compromised account.

Installing updates of CMS is quite a daunting task for some, but following this one-liner code can make things easy.

In cPanel server, run the following single line command:

find /home/*/public_html/ -type f -iwholename “*/wp-includes/version.php”
-exec grep -H “\$wp_version =” {} \;

While on a Plesk server, the single, one line command would be

find /var/www/vhosts/*/httpdocs/ -type f -iwholename
“*/wp-includes/version.php” -exec grep -H “\$wp_version =” {} \;

The output will be like this:

/home/username1/public_html/wp-includes/version.php:$wp_version = ‘4.1’;
/home/username2/public_html/wp-includes/version.php:$wp_version = ‘3.2.1’;
/home/username3/public_html/wordpress2/wp-includes/version.php:$wp_version =
‘3.5.1’;