Connect with us

Hi, what are you looking for?


Upgrade Your WordPress Site via the Command Line

Without a doubt WordPress is one of the best, most popular user friendly open-source CMS (Content Management System) platforms today. One of the very few bad sides of WordPress is that this CMS platform is frequently exploited by hackers who want to take over the control of your blog/website.One of the most popular methods used by hackers is to look up for known vulnerabilities in old WordPress versions. They can easily compromise your web site or ever worse, they can compromise your entire WordPress VPS if they find a security hole in your WordPress installation. That is why it is extremely important to keep your WordPress up to date and always run the latest version of it. WP-CLI is a set of command-line tools for managing WordPress installations. It gives a facility of updating plugins,set up multiple installs and much more,without using a web browser.The WordPress update can be done very easy in less than 5 minutes.


You can update your WordPress installation on your Virtual Private Server (VPS) following the instructions below.

First of all, do not forget to make backup of the existing WordPress directory and MySQL database

# mysqldump -u WPUSER -p WPDATABASE > /tmp/backup.db.sql
# tar -zcvf /tmp/wpbackup.tar.gz /var/www/html/website

After the backup is completed, go to the directory where WordPress is installed and download the latest version from their site and unzip the downloaded file:

# cd /var/www/html/website
# wget
# unzip

Delete the old ‘wp-admin’ and ‘wp-includes’ directories:

# rm -rfwp-admin wp-includes

Copy the content from the extracted directory to your current directory:

# cp -arwordpress/* .

Remove the downloaded zip file and ‘wordpress’ directory:

# rm – rf wordpress/.

After all you should login to http://yoursite.tld/wp-admin/upgrade.php and finish the update.

By effectively using wp-cli, you will no longer have to continually switch between the web browser and the terminal window when doing changes that might not be available from within the web interface.

It is not only important to have a successfully running WordPress site over the internet, but it is equally important to know the steps for securing your WordPress site against unauthorized access of hackers. You should keep a check on your site’s performance and security by updating your WordPress Installation regularly to ensure its better performance.

Written By

Joy Mali is a certified digital analyst who helps online businesses to perform better on the web with best solutions & advice. Her content is featured on many mainstream sites & blogs.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like


You know when you buy a product, say, a motorcycle, you are required to maintain it? It comes with about four to five free...


Is it accurate to say that you are searching for an all in one solution for your site? Do you have to update your...


Well, Resetting your website is one of the best options if you are testing new Plugins. Or if you want to test a theme...

Digital Marketing

As anyone who has a website can tell you, it’s hard to bring in visitors. But what’s sometimes even harder is bringing back those...