I want to do some changes on WP for a friend but I don't want to do it live. So I was thinking of cloning the current WP to another directory on the same server and then do work on that version (www.myfriendswp.com -> www.myfriendswp.com/testing) and, when done, clone the changes back to main directory.

Is this possible or will there be some problems? Most tutorials and plugins are talking about cloning to a different server.

2 Answers 2


I would recommend to clone it on a subdomain. Something like "testing.myfriendswp.com". I have tried this approach and it works fine. If you have a cpanel, you will see an option to create a subdomain in it. create a subdomain and point it to a folder inside public_html. So, for example, your subdomain "testing.myfriendswp.com" will be pointed to a directory "public_html/testing". Once you have the subdomain created:

  1. copy the WP files from the main domain to subdomain
  2. create a new database and import tables from the main DB to it.
  3. set appropriate DB credentials in wp-config.php file
  4. change the domain name in the wp-options table in the new DB.
  5. boot up WP on the subdomain and refresh the permalink settings.
  6. Run a search replace script on DB to replace main domain to the subdomain.

For extra security, add a robots.txt file on your subdomain to prevent the instance from being crawled by Search Engine Robots.



Yes you can clone the website on the same server in another directory . You may follow below steps.

  1. Copy entire wordpress root directory in another folder for ex. Beta.
  2. Create a new DB and copy the existing database into the new DB . You can use same DB by changing WP prefix but I would recommend having a new DB.
  3. Change the db details in wp-config.php files.

If you have any doubts in above please let me know . I will guide you for the same

  • Thanks. I was able to clone WP, but now when I try to access it, I get redirected back to the original WP. Why?
    – c0dehunter
    Nov 29, 2017 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.