Support » Localhost Installs » Change URL, can't login to wp-admin

  • Hello. I know there are a lot of posts regarding this topic. I dug through them, but did not find anything that answered my question (not to say it isn’t there, I just didn’t find it.) I apologize in advance for making someone repeat themselves (and also for being long-winded.)

    Here’s the scenario:

    I am replacing my company’s old website (not WordPress site) with a new one (is WordPress site). I created the new site using Xampp as the local environment “server.” All of my WordPress files are stored here:


    The WordPress Address (URL) and Site Addres (URL) are both:


    I needed to change the name of the URL to “mynewsite”. To do this, I created a new folder “mynewsite”, copied all of the files from “wordpress-trunk” into “mynewsite” and stored it here:


    Then I changed the WordPress Address (URL) and Site Addres (URL) via /wp-admin Settings->General Settings to:


    The site performed exactly as it should, however, when I tried to access /wp-admin after changing the URL, I was unable to so. I was able to revert the URL back to the original thanks to great support forums and (I used the “Changing the URL directly in the database” method.) Once the site URL was changed back to http://localhost/wordpress-trunk, I was able to access /wp-admin again.

    Here’s the question:

    I am migrating the local site to our public server soon and need to change the URL to that of the current site that I am replacing. However, this experiment showed me that, by my method, if I change the URL, I lose /wp-admin access.

    How do I change the URL and maintain /wp-admin access?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • In this case you have to take help of searchreplacedb2.php
    Before doing something please take a backup of your database.
    Download searchreplacedb2.php from Github

    OK, Let’s start from beginning.
    After Download searchreplacedb2.php put that file to your mynewsite folder.
    Now Hit the below link in your browser:
    Now click on “submit”->then “Submit DB details”->then click on “Continue”->

    Now you see the below screen:
    What to replace?

    Search For: localhost/wordpress-trunk
    Replace with: localhost/mynewsite

    Then Submit Search String.

    Now go to http://localhost/mynewsite/wp-admin

    Now you can login to your newsite.

    I strongly suggest that you use the plugin “DUPLICATOR” to manage the transition of your website to your hosted platform. This plugin will look after all the tricky steps for you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change URL, can't login to wp-admin’ is closed to new replies.