Change WordPress Domain using

  1. sudo curl -O


  1. From User@UbuntuServer:/var/www/html$ I will run the following command to make sure that the command is working

sudo php wp-cli.phar –info


  1. I’ll move the file to a new path and location so I can access it from anywhere using only the command WP.

First I will give the required permissions

moh10ly@Ubunut-Mohammed:/var/www/html$ sudo chmod +x wp-cli.phar


Next I will move the file

sudo mv wp-cli.phar /usr//local/bin/wp


  1. Check if the file is working properly after moving?


  1. Final step is to change the domain of your wordpress site to a new domain.

My previous domain was and now I changed it to

So I only used two commands to change the domain name to the new one



Now I tested my website and it’s working perfectly…


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.