• Skip to main content
  • Skip to footer

Blake Imeson

Web Entrepreneur | WordPress Geek

  • Home
  • About Blake
  • Connect with Me
  • Contact

Blake Imeson / September 10, 2010

Accidentally Changed the WordPress Site Address?

If you have accidentally changed the WordPress Site address in General Settings and now cannot access your site, this post is for you.

Inspired by this Smashing post, What Is The Worst Design or Programming Mistake You’ve Ever Made?, I decided to share mine and hope that this post can be my “Iceberg, dead ahead!” cry.

Setup: I was working on a new client site. I had a development site going in one tab and their live site in another. Problem was that the WordPress backends looked almost identical.

I thought I was changing the WordPress site address on my dev build but I was on the live one. Eek!

When I changed this address WordPress thought it lived elsewhere. The only way I knew at the time to fix this was to use PHPmyAdmin to muddle through the database and find that field and change it back.

I felt a shock of terror run through me as I just took a live and very public site offline and it was now redirecting to my website and the dev subdirectory I was using. I eventually got PHPmyAdmin access and changed it but I have since learned a trick that only requires your being able to edit WordPress’s wp-config.php file

There’s a fix!

Using FTP, open up the wp-config.php file found in the root of your website files, edit it with a notepad  program. Here is what the file will look like in FTP:

wordpress-config-file-ftp
and paste these lines (with your site name) into it after the initial commenting:

define('WP_HOME', 'http://sitename.com');
define('WP_SITEURL', 'http://sitename.com');

(Taken from my beautiful WordPress code snippets list)
When you do this, the fields for this in the WordPress backend will be uneditable and grayed out. This is a good idea if you are passing a site off to a client who will have full admin access. This will prevent them from accidentally changing this very important WordPress option.

EDIT: It appears there is also a way to do this with the functions.php file if you have access to that and not wp-config.php

Hope that this is helpful! Comment if you have done the same thing so I don’t feel I am the only one. :)

1.4k
SHARES
LinkedinShareTweetSubscribe to BlogEmail
Subscribe to Blog via Email
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Email Address Subscribe Now

Filed Under: Tech Tagged With: Site address, WordPress, wp-config.php

Related

Reader Interactions

Comments

  1. Taylor says

    September 19, 2010 at 3:36 am

    Oh, man. You totally saved the day. I’m surprised this post doesn’t get more comments, man. I changed my site address from url/blog to just url, and it screwed everything up.

    Like most people probably do, when they notice their site is completely down, I hit the back button on my browser, to go back and change the setting, back to normal. Well, of course, this isn’t possible, because your site address is now different.

    Thank goodness I ran across this post, though. God knows I won’t be making that mistake again.

    :)

    Reply
    • Blake Imeson says

      September 19, 2010 at 10:47 am

      Glad it helped!

      I only published this last week so I expect more comments as people find it useful :)

      If you can, link or share this post so others can also benefit from our mistakes.

      Reply
      • Tina says

        November 8, 2014 at 8:44 pm

        Hi Blake, maybe this is a rooky mistake, but I was going through the general settings in the DIVI theme on my localhost server and stupid me thought I would change the site address and url. Which came up with a syntax error. So I read your quick fix and managed to fix the error. However it has changed the actual live url as well so if I was to login into the live site it comes up with the error. So I am not sure what has happened here and do you have a fix. The live site as a drupal site.

        Tina

        Reply
        • Blake Imeson says

          November 10, 2014 at 8:24 am

          this is very strange. So was there any files changed on the live server or DNS?

          Maybe this is a browser cache issue?

          Reply
      • Ayaan says

        December 19, 2016 at 6:09 pm

        I works but it not changing ip address to local host still trying to connect ip address and my css files and other files are not loading

        Reply
      • Deepayan Choudhury says

        August 12, 2017 at 2:19 pm

        I thank for the fix. It really helped me to get back my site again.
        Next time, I will be more cautious about changing any settings.

        You rock!

        Reply
      • Dan says

        February 5, 2019 at 9:12 pm

        Hi Blake,
        Thanks for this post.
        And, yeah, we are [still] reading this in 2019 and we [still] find relevant and useful.

        However, the method you shared here — define(‘WP_HOME’, ‘http://sitename.com’);
        define(‘WP_SITEURL’, ‘http://sitename.com’); — is not (necessarily) the best option, WordPress reveals. Reason being, you won’t be able to edit the values anymore, since they are hardcoding.

        It’s better to try this method instead. I used it and recovered from my mistake. Follow the link here to see the details. https://codex.wordpress.org/Changing_The_Site_URL

        Good luck, guys ;)

        Reply
        • LimeCuda says

          February 7, 2019 at 11:33 am

          Yes, you are right the values will no longer be editable in WP backend. I consider that a good thing though because it prevents someone from accidently doing what caused the issue in the first place :)
          In our world it prevents clients from accidently taking down a site.

          Reply
  2. Taylor says

    September 19, 2010 at 2:17 pm

    Hey. Just noticed that as it did help, the deep URL’s within my site are still not working. I’ll be looking for a solution, and let you know what I find. :)

    Reply
  3. Taylor says

    September 19, 2010 at 2:26 pm

    SOLVED: Blake. I would add the information in my comment to your post. :) As some people will follow your suggestions, but still may have issues reaching the DEEP URLS within their website.

    Hey everyone. If you have followed Blake’s post, but still cannot access deep URLs within your site, such as URL.com/post, go into your “wp-admin” options. From there, use the left navigation and click “settings.” Then, click “permalinks.” Change your permalinks to “default,” then, change it back to what you originally had it set at.

    “This will cause a rewrite of the htaccess file that controls the ‘pretty’ names.” – From poster at BytesForAll.com.

    This will solve the rest of your problem, completely. :)

    Happy blogging. :)

    Reply
    • Deepayan Choudhury says

      August 12, 2017 at 2:15 pm

      Thank a ton!

      Reply
  4. Blake Imeson says

    September 20, 2010 at 8:36 pm

    @Taylor thanks for the update.

    You should also be able to just click “update” on the permalinks page to have it reapply the .htaccess change. Also, some hosts don’t allow that type of access by the server to .htaccess so some people may need to paste in the right code back into .htaccess

    Glad it worked for you! It can be a frightening mistake to make. :

    Reply
  5. Richard Dennis says

    September 27, 2010 at 4:04 pm

    I made this mistake today. I added the code and my site is back up. However, I can’t seem to login to my admin area now? Did I miss something?

    Thanks,

    Richard

    Reply
    • Tiffany says

      June 5, 2019 at 7:20 pm

      This is what happened to me! I don’t know how to log in. I’ve tried going into the database and adding a new user, I’ve tried resetting the password and nothing is working. Adding www didn’t help.

      Reply
  6. Richard Dennis says

    September 27, 2010 at 4:06 pm

    Nevermind… I figured it out. Had to add the www.

    Thanks anyways for the posts… you saved my butt!

    Reply
  7. Nel-Marie says

    October 13, 2010 at 11:03 am

    Hi Blake

    This helped me a lot. However I need to change my URL from http://www.example.local/wordpress to http://www.example.com

    If I go to http://www.example.local it displays the index of my root folder, I want the wordpress site to resolve on the http://www.example.local only.
    Help?

    Reply
    • Blake Imeson says

      October 13, 2010 at 11:15 am

      @Nel-Marie I use a plugin called BackupBuddy that allows easy migration like what you need.

      You could do this manually by moving all the file from what should be /public_html/wordpress/ to /public_html you would then have to redefine the site location like I showed in wp-config.php. That should do it.

      That help at all?

      Reply
  8. Fabio Lizak says

    October 13, 2010 at 7:20 pm

    Hi Blake,

    Thanks for this post, I was also saved by it.

    I have the same doubt of Nel-Marie, i would like to change http://www.example.local/wordpress to http://www.example.com

    However, since my wp-config.php file was changed manually i can only edit it manually too. Which line i must change to http://www.example.com, ‘WP_HOME’ or ‘WP_SITEURL’?

    Reply
    • Blake Imeson says

      October 13, 2010 at 7:31 pm

      I think you should change both to the new URL. You may need to also do a find/replace in your database (using phpmyadmin likely) to fix any broken URLs.

      Either of you try this yet? BackupBuddy solves this problem very completely if you are up for paying for it.

      Reply
  9. Fabio Lizak says

    October 13, 2010 at 7:48 pm

    I’ll try that and tell you guys if it worked.

    Thanks again Blake.

    Reply
  10. Charlie says

    November 2, 2010 at 12:29 pm

    Life saver. Thanks for the info!

    Reply
  11. Andreas says

    December 29, 2010 at 8:18 pm

    Great save! Thanks for sharing,saved me a lot of problems!

    Reply
  12. brajesh says

    January 2, 2011 at 2:03 pm

    i mistakenly changed my url. I do not have a config file. I do not have access to myphp. I do not have a database. What should I do?

    Reply
    • Blake Imeson says

      January 2, 2011 at 4:10 pm

      @brajesh If you are running WordPress then you should have a config file. It will be located at the root of your WP install. So if you have your site at .com it will be at .com/wp-config.php and if it is accessible at .com/blog then it will be at .com/wp-config.php.

      Your options to edit the file are primarily to use an FTP program (FileZilla is good) and a text editor to make the additions to the file. Or if you don’t have FTP access then your host may have some kind of online file editor that lets you interface with files on the server.

      Every WordPress install has a MySQL database – you just may not be able to access it. What host are you using? (I recommend HostGator BTW)

      You can email me at blake at blakeimeson.com if you need more help. To help more I would need more info.
      ‘

      Reply
  13. Joey Mama says

    January 17, 2011 at 4:33 pm

    I seriously love you. Thank you.

    Reply
  14. ara says

    February 5, 2011 at 2:36 pm

    Thanks a million. I was wondering how to get out of this mess.

    Thanks again

    Reply
  15. Brand says

    March 5, 2011 at 7:43 pm

    Thanks so much for this post. This was very helpful.

    Reply
  16. ks says

    March 29, 2011 at 7:44 pm

    you are a lifesaver!

    Reply
    • Blake Imeson says

      March 29, 2011 at 7:52 pm

      @ks glad to help!

      Reminder that if anyone finds this helpful to link to it, tweet it, and share it, thanks :)

      Reply
  17. Fernando Tapia says

    March 30, 2011 at 10:19 pm

    Muchas Gracias!! :)

    Reply
  18. Kate Callahan says

    April 11, 2011 at 5:04 pm

    Blake was such an answer to prayer. He came in and saved the day for me when other phone calls support emails and live chats ended with disappointment, frustration, and panic. Blake – a million times thank you. I appreciate your help and just hope that your calendar fills up with work (that makes you $$)

    Reply
  19. LMW says

    May 11, 2011 at 12:47 pm

    THANK YOU!!!

    Reply
  20. Eric Newby says

    May 12, 2011 at 6:43 pm

    Wow you are a hero. Thank you so much for posting this.

    Reply
  21. LaTonya says

    May 30, 2011 at 9:00 pm

    Blake I’m so happy I found this post and your blog. I have been in a state of panic all of this wonderful Memorial Day as I too changed the url on my wordpress blog and haven’t been able to login in to my admin page.

    I’m sure like most, you’re still enjoying a barbecue somewhere. So I’m going to email you more background info about my problem and perhaps at your first convenience tomorrow you can “make my day”

    I will definitely be singing your praises on twitter and my blog (whenever I can post again:))

    Cheers!

    Reply
    • Blake Imeson says

      May 30, 2011 at 9:19 pm

      LaTonya, I’d be happy to help. Shame to be in a state of panic, especially when this can be fixed relatively easily. I’ll be watching for your email.

      Reply
  22. DesignbySPIRIT says

    June 10, 2011 at 3:08 am

    WOW!!!! You just saved my life. Found this just when I was considering a re-install.

    Reply
  23. Foxcrawl says

    July 29, 2011 at 7:53 am

    Hi
    Is it any problem if keeping e.g. the wordpress address as non-www and website address as www?

    Reply
    • Blake Imeson says

      July 29, 2011 at 9:00 am

      No, that should be fine. You are talking about having two different sites? As in have a non-wp site at www. and the wp one non-www.

      Since www is technically a subdomain that works but keep in mind most users don’t understand that www and non-www are two different addresses. Probably best practice is to just have one redirect to the other (I prefer non-www)

      A better way to have a wp site coexist would be to have it as a subdirectory like .com/blog or a subdomain blog.sitename.com

      That answer your question?

      Reply
  24. Foxcrawl says

    July 30, 2011 at 6:23 pm

    Hi Blake and thanks. Indeed www and non-www are different. I was talking about only one site and as you know in wp-settings you can choose www or non-www for both the WordPress-address and website address). I chose wp-(installation) adress as non-www and website address as www. For example for my site i have: http://foxcrawl.com/wp-etc.. and the site (as seen in browser) is http://www.foxcrawl.com. So far everything is fine but wanted to ask because having one more oppinion is better:)
    Thanks and sorry for this long message.
    Cheers.

    Reply
    • Blake Imeson says

      July 30, 2011 at 6:55 pm

      Appears to be working just fine for you Foxcrawl. The main issue would be if you could access multiple versions of a page but I just tried on your site and it was redirecting to www.

      Reply
  25. Jim Owen says

    August 6, 2011 at 12:29 am

    Thanks so much – had a complete melt down, as I am a complete novice when it comes to this type of thing – was trying to install WORDPRESS on host gator, set up a sub-domain and have 2 websites running from separate domains – all went wrong and couldn’t access either site….thanks to that code – i have my original site back….thank goodness!

    Reply
    • Blake Imeson says

      August 9, 2011 at 6:08 am

      @Jim glad it worked for you!

      Reply
  26. ummi says

    August 31, 2011 at 5:47 pm

    Thanks……………………………..

    Reply
  27. Jess says

    September 6, 2011 at 9:32 am

    Much like the other posts on here – THANKYOU SO MUCH

    Reply
  28. Nicole says

    September 17, 2011 at 2:04 am

    Hi Blake, hoping you can help me, this site’s setting accidentally was changed from http://www.purefastpitch.com/blog
    to http://www.purefastpitch.com , thought it was harmless but come to find out the site went down and now can’t find it or log in
    I am in the file manager and my hosting files are sitting in network solutions.com. I followed the directions
    Open up wp-config.php and paste these lines (with your site name) into it after the initial commenting:

    define(‘WP_HOME’, ‘http://sitename.com’);
    define(‘WP_SITEURL’, ‘http://sitename.com’);
    but still nothing.
    can you please help, I feel really bad since its been a couple days without fixing. I do not have php admin access only ftp access. Thanks for your help in advance Nicole

    Reply
  29. elly says

    September 26, 2011 at 2:01 am

    I accidentally changed my url and i have tried to redo my website w/your advice but it seems that i don’t get it.

    m website was originally http://www.abc.com/def/ (substituted name hehheh) and i wanted to change it to http://www.abc.com. so i changed it on the general setting (w/o really thinking) and i am unable to get in. I can get to the login page by doing http://www.abc.com/def/wp-login.php but when i log in it tries to take me to http://www.abc.com/wp-login.php and it will start that error message. so i tried changing it by typing out
    http://www.abc.com/def/wp-login.php/define(‘WP_HOME’, ‘http://www.abc.com/def‘);
    define(‘WP_SITEURL’, ‘http://www.abc.com/def/‘);
    and i refresh it then try to log in but it still tries to reroute me to http://www.abc.com/wp-login.php and it will be an error again.
    Can you please let me know if I am doing something wrong? Thank you! And thank you so much for taking your time to help me and many others too! You are so awesome!
    -elly

    Reply
  30. elly says

    September 26, 2011 at 2:02 am

    p.s. i can’t seem to find wordpress on my PHPmyAdmin. : (

    Reply
  31. Ed Hohlbein says

    October 23, 2011 at 10:16 am

    THANK YOU, BLAKE. You’re my hero. Brand new to WP and had no confidence that I could fix what I had broken. You’re sharing and generosity got me through this hiccup. Appreciated. The only thing I would add is that I had to reset my password to get back into WP Admin page. Other folks who are newbies like me might find this tidbit useful. Thanks again. You ROCK!

    Reply
  32. Francisco says

    October 27, 2011 at 8:00 pm

    omg, you are my hero!

    Reply
  33. Rick says

    December 19, 2011 at 6:56 pm

    Wheeewwww!!! Big Exhale!!! Thank-you so much for posting this!

    Reply
  34. Ric says

    December 20, 2011 at 1:07 am

    While this allowed me to get a badly formatted version of my site up and running, and allowed me to log in to my admin section. The layout was all screwed up. am i missing something?

    Reply
    • Blake Imeson says

      December 20, 2011 at 7:11 am

      Hey Ric, if you email me some details (blake-at-blakeimeson.com) then I can take a look at it for you.

      Not sure why this would be happening. Could have to do with the way images/css are referenced off of the site URL. You made sure to omit the and slash after .com in both of the DEFINEs?

      Reply
  35. isabluue says

    December 29, 2011 at 4:13 pm

    My hero!!!! Thanks a lot!!! :D

    Reply
  36. Cliff says

    January 3, 2012 at 2:41 pm

    Blake Imeson – God among men…

    Reply
  37. John Smith says

    January 14, 2012 at 11:11 am

    Blake, you’re the man. My agency is adding a WP dev division to service small business owners, and in the learning curve, I made this oopsie. Thankfully it was a new site that hadn’t launched, but I still felt the ice run through my veins when I realized I couldn’t just fix it by hitting the back button.

    THANKS!!!

    Reply
  38. Soldier_ET says

    January 20, 2012 at 10:31 am

    Man thank you so much!

    Reply
  39. kiko says

    January 23, 2012 at 2:44 pm

    thanks man!

    Reply
  40. Scott Mosteller says

    February 10, 2012 at 7:49 pm

    I LOVE YOU! Worked great! THANK YOU!

    Reply
  41. Heidi Wagg says

    February 17, 2012 at 1:04 pm

    Hi there, I’m a writer and have been developing the content for a client’s website. A third-party web developer installed WordPress so I just basically have access to the site. Anyhow, I noticed that the company’s name on the web address is wrong so I went in and changed the settings to the right spelling… but then disaster struck and I couldn’t change it back. I’m actually feeling sick about it, because now the site is gone. I’ve contacted my client and have not heard back from the developer. How hard is it to fix this problem? Should I be worried? Is there anything I can do?

    Reply
  42. Hugh says

    February 23, 2012 at 6:21 pm

    I can’t thank you enough for helping me with this. In the end I decided to edit the functions.php in my theme options and create my work around that way.

    However, none of my subdomains now see to load e.g. http://myblog.123.com/PICS/
    I get an error if I click on the Pics subdomain. (500 Internal server error)

    Can you please help?

    Reply
    • Blake Imeson says

      February 24, 2012 at 6:14 am

      Is there a reason you didn’t use the wp-config.php route? Sometimes resaving the permalinks will clear up any errors.

      Are the subdomains separate instals or part of WordPress MU?

      Reply
  43. Brian says

    March 9, 2012 at 12:05 am

    The fix worked great (after I wasted a day trying to fix it before finding your post). I had just finished setting up my blog and linking to it to facebook when I decided to change from non-www to www. Only trouble is that my rss feed no longer works get (404 error for wordpress blog feed). Any ideas?

    Reply
    • Blake Imeson says

      March 9, 2012 at 6:43 am

      Hmmm… that is strange. I just checked it out. Try resaving the permalinks.

      Did WordPress move on the server?

      Reply
  44. marianney (darling blogs) says

    March 14, 2012 at 8:45 pm

    thanks so much! totally saved my day :)

    Reply
  45. D. says

    March 16, 2012 at 7:29 pm

    These settings are not working for me, what am I doing wrong? When putting in the link mysite.org/site/wp-config.php it just goes blank. Any other version of anything takes me to a 404 error page. This is the original name of the site and I was trying to take away the /site…
    And when in phpAdmin I don’t see a wp-config file. Should I make a new one or what? I am totally lost. and I am using hostgator!

    Thank you!

    Reply
    • D. says

      March 16, 2012 at 7:39 pm

      wow, I was finally able to get my site back to before… in a total different way. I couldn’t figure out the wp-config stuff, but when looking at my phpmyadmin and looking through all the files, I went to wp_options and in there was site-url that was pointing to the .org without the /site… I just added the /site back to it, saved and it all went back to before.

      However, the question now is, how do I actually change the url to get rid of the /site?

      Reply
      • Blake Imeson says

        March 16, 2012 at 10:13 pm

        Ideally, you would use something like BackupBuddy http://pluginbuddy.com/purchase/backupbuddy/

        You could also move all the files in FTP to the root (I assume that it is currently at .com/site/) and then you could change the couple places in wp_options that have the site / home URLs to match.

        Reply
      • Ella says

        March 28, 2015 at 1:47 am

        Now leaving the heart attack zone, omg, ha! After hours of searching and getting ready to do a clean install the commenter D.’s advice from March 16, 2012 about going into the phpMyAdmin section worked for me, no fuss at all. I’m very new to WordPress and hadn’t realized how attached I’d become to my site-in-the-making until it went 404 on me! Won’t be going there again. So glad I came across this page, thank you!

        Reply
  46. Crystal says

    March 27, 2012 at 4:29 pm

    My hero! Thanks :)

    Reply
  47. Teresa Meehan says

    April 11, 2012 at 1:00 am

    You’re still saving lives. I made the exact same mistake you did. I never would have figured out the solution on my own because I don’t understand web programming that well. Thank you so much for posting this!

    Reply
  48. Jackie says

    April 12, 2012 at 3:55 pm

    Thank you, thank you, thank you!

    Reply
  49. Mónica Guerra Leiria says

    April 14, 2012 at 3:09 pm

    You, sir, are a lifesaver. I cannot express enough the state of hair-pulling nail-biting despair I was in when I thought I’d just lost all the work I’d done – thank you! It bears repeating – THANK YOU! You totally saved what’s left of my sanity!

    Reply
  50. Bryan says

    April 18, 2012 at 8:26 am

    Perfect! Indeed a lifesaver. going to my bookmarks with this post!

    Thanks.

    Reply
  51. Tom says

    April 21, 2012 at 9:52 am

    I wish it worked for me also…. cry… I did insert the two lines as you suggested but I can not log in anylonger. I tried it with and without www. Any suggestion?

    Reply
  52. Tom says

    April 21, 2012 at 10:05 am

    Resolved, I had the Home and Site URL mixed – tks!

    Reply
  53. Andrew says

    May 4, 2012 at 10:41 am

    Another rookie web designer saved–thank you so much for sharing this.

    Reply
  54. Sharon Markum says

    May 18, 2012 at 2:24 pm

    Great information :)

    Reply
  55. KLI says

    May 25, 2012 at 4:46 am

    Brilliant! Thanks – saved the day!

    Reply
  56. Lang Elliott says

    May 31, 2012 at 7:33 am

    Blake:

    I have a fairly large web site where my WordPress Address (URL) and my Site Address (URL) are set to “http://www.musicofnature.org/home”.

    This means that every web page has the “home” subdirectory in its address. Thus, I would like to change my Site Address (URL) to “http://www.musicofnature.org” to get rid of the “home” folder. If I do this in WordPress, will it mess up everything?

    Also, I own BackupBuddy but it doesn’t appear to be able to solve this particular problem. Or does it? So what should I do?

    Any help will be much appreciated.

    Reply
    • Blake Imeson says

      May 31, 2012 at 8:25 am

      Hi Lang, Yes, that should actually be an easy move using BackupBuddy.

      Take a full backup (if site is too large you will have to do a database backup and manually shift files up one level to the root) and place the backup zip and the importbuddy.php file in the root of your site (usually public_html or www in FTP)

      You can use importbuddy to expand the site to the new location and even use the same database name/user/pass , I would recommend using a different table prefix so you don’t overwrite previous database (just in case!) So instead of wp_ (e.g. wp_options) you would set it as wp_123_ and then it would end up as wp_123_options in the database.

      If you hit a roadblock or are nervous, I am available for hire for these types of moves. I’ve migrated well over 150 sites.

      Reply
      • Lang Elliott says

        May 31, 2012 at 10:00 am

        Thanks Blake. But I don’t want to move my site out of the “home” folder. I want to leave it there because I have lots of other stuff cluttering my root folder. In other words, I just want to change the Site Address (URL) so that the “home” subdirectory does not appear in web page addresses.

        I googled and found the following instructions:

        http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

        Open that page and go down to “Using a pre-exiting subdirectory install”.

        BTW, I have full backups copied to Amazon S3 via BackupBuddy.

        Reply
        • Blake Imeson says

          May 31, 2012 at 10:31 am

          Ah ok. I didn’t realize you didn’t want to physically move it to keep the server clean.

          That link looks good. I’ve never done that particular move but it looks like you shouldn’t have much trouble with it.

          If you don’t mind, comment back here post-move I’d love to hear how it went and if there were any unexpected hurdles.

          Reply
  57. Ashley says

    June 27, 2012 at 2:36 pm

    OMG Blake – you are a life saver!!!

    THANK YOU so much!
    I thought I was going to have a heart attack!! Ugghh!
    I will be bookmarking your page right now! :)

    Reply
    • Blake Imeson says

      June 27, 2012 at 2:48 pm

      Glad you found it helpful :)

      Linking to this page will help Google understand that it is helpful and then I can save more people this terrible grief.

      Reply
  58. malkera says

    July 7, 2012 at 2:06 pm

    Thanks a lot…. I fixed it via your tutorial…It was great shock for me…. Thanks Again..

    Reply
  59. wheay says

    July 12, 2012 at 4:08 am

    thank you so much, had to comment which i dont normally do, you save my…

    Reply
  60. Aimee says

    July 23, 2012 at 1:43 pm

    THANK YOU SO MUCH!!! I was ready to cry that I did this, and you saved it. :-)

    Reply
  61. Angel says

    July 27, 2012 at 5:59 pm

    You saved my whole day. Thank you

    Reply
  62. Brenda says

    August 1, 2012 at 9:49 am

    Thank you! I also had to resave the permalink settings for the inner pages to work. Easy fix!

    Reply
  63. David says

    August 8, 2012 at 1:44 pm

    Thanks for this! another butt saved.

    Reply
  64. Yuliana says

    September 25, 2012 at 4:35 pm

    Hi everyone,

    I also need help, our webmaster is out of the country and we happened to have changed the wordpress and site address to a redirecting URL since the original was different from what we had used in our flyers. We are not able to login to the backend and have no clue how to fix it or what this PHPmyAdmin means. Is someone able to help?

    Reply
    • Blake Imeson says

      September 25, 2012 at 4:46 pm

      I sent you an email. I’d be glad to try and help.

      Reply
  65. Beth says

    November 2, 2012 at 12:05 am

    I’ve just launched 2 different WP sites that I’ve moved to new hosts. For development, I used temporarily URLs (in one case IP/subdirectory, in the other is was a ###/host.com temp url that they assigned).

    For launch, after pointing the domains to the new host, I change the site URL to the actual domain and the site works fine.

    I left the wordpress (home) url the same (well, in the case of the first one, I used the rescue methods above to make it the same again and bring the site back up :/) and the admin is working fine too.

    The only possible issue is that when I go to domain.com/wp-admin it immediately redirects to the temp url (Which is still the wp home url).

    Those temp URLs are not going to stop pointing to those files, so is there any reason to jump through hoops to change the home URL, or should I just tell the client not to worry about the fact that the IP is showing up in the admin rather than the domain?

    thanks in advance!

    Reply
    • Blake Imeson says

      November 2, 2012 at 7:22 am

      If you have PHPmyAdmin access I would go in there and try to fix that. Probably isn’t a big deal but it could cause you issues in the future if you move hosting (or IP addresses) – also when you go from the admin to the front of the site does it switch back?

      Reply
  66. Brian says

    November 30, 2012 at 4:20 pm

    You just saved my life. Thank you!

    Reply
  67. Irina Mix (@irinamix) says

    January 5, 2013 at 12:30 pm

    THANK YOU from Panama, Central America !! You saved us a lot of work !

    Reply
  68. Karls says

    January 22, 2013 at 10:15 am

    You are a lifesaver, great article!!

    Reply
  69. Bere says

    February 11, 2013 at 2:27 pm

    Hi! I agree with Karls – you’re a LIFESAVER. Blessings to you for sharing this knowledge with all of us who need it.

    Reply
  70. مصطفی says

    February 15, 2013 at 12:50 pm

    thank you bro, you saved my time

    Reply
  71. Edgar Byo says

    May 22, 2013 at 8:08 pm

    Thanks You just save me!! :)

    Reply
  72. Edgar Byo says

    May 22, 2013 at 8:15 pm

    Sorry, I got the homepage working, but none of my pages came back :/ Can you plz help?

    Reply
    • Blake Imeson says

      May 22, 2013 at 9:02 pm

      You probably got my email reply already but I just resaved the permalinks for you and it seemed to fix it -Blake

      Reply
  73. jfdsa says

    May 24, 2013 at 10:51 pm

    Thank you!!!!!!!!!!!!!!!!!

    Reply
  74. Katy Hall says

    July 5, 2013 at 2:23 pm

    Blake…you saved my skin! Freaked out for quite a while there!

    Also Trevor, thanks for the additional info….

    PHEW!!

    Reply
  75. Jo De Munck says

    July 7, 2013 at 2:50 pm

    you derve the nobel prize

    just mention on the explanation:

    paste the code before the words

    “happy blogging”

    that did the trick for me!

    thanks a zillion time !

    Reply
  76. Qa Qu says

    October 27, 2013 at 2:09 am

    Hello there, I have same problem. I did change the address in General Setting and suddenly the site become horrible. Please someone. Can you all help me? I will give the username and password for my ftp client because I don’t know to make it normal. Please someone contact me at qaqudotcom@gmail.com. The customer want to see this site tomorrow. :(

    Reply
  77. Qa Qu says

    October 27, 2013 at 2:10 am

    Hello there, I have same problem. I did change the address in General Setting and suddenly the site become horrible. Can you all help me? I will give the username and password for my ftp client because I don’t know to make it normal. Please someone contact me at qaqudotcom@gmail.com. The customer want to see this site tomorrow. :(

    Reply
  78. Ian says

    November 4, 2013 at 12:34 pm

    Thanks Blake – still saving bacon three years on!

    Ian

    Reply
  79. Jools Stone says

    February 10, 2014 at 2:26 pm

    Hi Blake

    Firstly thanks for this very handy tip! But I have a very quick question. What if you wanted to actually change the url or have the old one divert to a better variant?

    Thanks
    Jols

    Reply
    • Blake Imeson says

      February 10, 2014 at 2:57 pm

      I think what you are asking is how to actually move the site? So if you have it at .com/site moving it to .com/site123 for example.

      Easiest way is BackupBuddy but alternatively you could do it with FTP and just create a new directory, move all the files, then change the database location.

      Reply
  80. Jools Stone says

    February 10, 2014 at 3:11 pm

    Thanks, but not quite, no. I was trying to change it in WP so that it re-directs to a better url. That’s how I got stuck.

    I think I changed both fields, thinking it was just some cosmetic change that I could change back easily on WP…. and then found it wasn’t and got locked out!

    Will greying it out in WP mean I’m stuck with the original url?

    Hope that makes sense?

    Reply
    • Blake Imeson says

      February 10, 2014 at 3:31 pm

      Graying it out means that is what you hardcoded as the location of the site in the wp-config.php file.

      If you want the site to “live” elsewhere that is a different issue than redirecting.
      Redirecting should be done in the .htaccess file but I suspect that is not what you are getting at.

      Could you describe the actual scenario and what you are trying to accomplish?

      Thanks,
      Blake

      Reply
      • Sam says

        January 7, 2018 at 2:08 pm

        now that i am able to log back into the site , how do i get rid of the gray. if i remove the code from wp config or functions i can’t log back in. did i lose the ability to change the site address from the general tab in the wordpress back end?

        Reply
        • LimeCuda says

          January 8, 2018 at 8:23 am

          You’d need to change that value in the database itself (like by using PHPmyAdmin

          Reply
          • Sam says

            January 9, 2018 at 10:47 am

            is there a link or tutorial for that. i am a novice when it comes database and worried to mess something up

          • LimeCuda says

            January 9, 2018 at 11:20 am

            This looks like a pretty good one https://www.hostdime.com/resources/change-wordpress-site-url-via-phpmyadmin/

            I just searched “change wordpress site address in phpmyadmin” in Google.

  81. Jools Stone says

    February 10, 2014 at 7:55 pm

    Sorry, sure. Let’s say the site is called http://www.propertysite.com and I wanted to change it to just http://www.property.com. I then went to change it on the settings menu of WP, overwrote something and then couldn’t get back into wp dashboard.

    First I want to be able to get back into the wp dashbrd, but I still want to change the name of the site so that it can be accessed with http://www.property.com. I have ftp access.

    What do I edit to restore access and then change the name safely?

    Sorry, I hope that made sense. I’m not especially technical and usually leave the php / ftp stuff and stick to just making changes in wp but Ive gotten over my head with this one.

    Thanks again!

    Reply
    • Blake Imeson says

      February 11, 2014 at 8:26 am

      So the issue of restoring access. You need to add those two lines to wp-config.php using FTP.

      Yeah, so the scenario you described would be a bigger change. You would need a new hosting account because the actual domain name would be changing. What is your current host?

      Do you own the other domain you are wanting to move to?

      You can either move the site yourself or maybe try one of these companies…
      https://fantasktic.com/
      http://thewpvalet.com/

      Reply
  82. Dolapo says

    February 19, 2014 at 6:22 pm

    God bless you. Not to be dramatic or anything but I was staring disaster in the face. Thank you, thank you and thank you!

    Reply
  83. sri says

    February 21, 2014 at 10:58 am

    i accidentally gave both Site address (URL) and WordPress address (URL) the same address ….. help me out

    Reply
    • Blake Imeson says

      February 21, 2014 at 10:59 am

      Did you try adding that code to fix it to wp-config.php ?

      Reply
      • sri says

        February 21, 2014 at 11:08 am

        now i am unable to access the site.. first it was blog.abc.org/wordpress .. then i changed both links to blog.abc.org… so can’t access…

        Reply
        • Blake Imeson says

          February 21, 2014 at 12:10 pm

          Do you have FTP or cPanel access for your site or is WordPress access the only thing you have?

          Reply
          • sri says

            February 21, 2014 at 12:26 pm

            WordPress access is the only thing i have..

          • Blake Imeson says

            February 21, 2014 at 12:27 pm

            I’m sorry then if you have no way to access any of the hosting aspects then this may not be unlockable.

            Did you purchase the hosting for this site?

  84. sri says

    February 21, 2014 at 12:33 pm

    ya.. just now got the FTP credentials from my friend.. how to proceed from here… need to change in wp-config.php ??

    Reply
    • Blake Imeson says

      February 21, 2014 at 12:37 pm

      Then just follow the instructions in the post above to add the define to fix it back to the way it was.

      Reply
      • sri says

        February 21, 2014 at 12:43 pm

        ok… thanks a lot :) :)

        Reply
  85. Lee says

    March 2, 2014 at 7:49 pm

    My partner changed the wordpress address (URL) and the Site address (URL). He thought it wouldn’t be an issue since we have two url’s directed to the site. try to do what you show but its not working. Any idea how to fix this?

    Reply
    • Blake Imeson says

      March 3, 2014 at 9:05 am

      Did you try the instructions above for changing the wp-config.php file?

      Reply
  86. fee says

    March 3, 2014 at 11:23 pm

    Hi Blake,

    re: ysalon.com.au

    I changed the wordpress address & site address to ysalon.com.au/index.php as I wanted to load a splash screen before the wordpress site.

    I added the lines below to wp-config.php

    define(‘WP_HOME’, ‘http://ysalon.com.au’);
    define(‘WP_SITEURL’, ‘http://ysalon.com.au’);

    now I get an error:

    ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.

    I’ve checked cookies & cleared cache etc. on both chrome & firefox and I’m still having no success in accessing ysalon.com.au/wp-admin.

    I tried commenting out cookie in wp-login:

    //Set a cookie now to see if they are supported by the browser.
    setcookie(TEST_COOKIE, ‘WP Cookie check’, 0, COOKIEPATH, COOKIE_DOMAIN);
    if ( SITECOOKIEPATH != COOKIEPATH )
    setcookie(TEST_COOKIE, ‘WP Cookie check’, 0, SITECOOKIEPATH, COOKIE_DOMAIN);

    But still no joy.

    Any idea would be appreciated.

    Thanks.

    Fee

    Reply
    • Blake Imeson says

      March 4, 2014 at 9:45 am

      What happens if you access it in an incognito tab on ff or Chrome?
      Was there anything else added to the site?
      The area in wp-config that has all the generated strings of text
      “# Security Salts, Keys, Etc”
      add some random characters in the middle of each string.

      Reply
  87. fee says

    March 4, 2014 at 7:42 pm

    I ended up creating a functions.php and adding:

    see link here:

    http://codex.wordpress.org/Changing_The_Site_URL

    This worked for me!

    Thank you for your support.

    Reply
  88. iwan says

    March 12, 2014 at 9:39 am

    Great!!! Your suggest to add the flolowing command :

    define(‘WP_HOME’, ‘http://sitename.com’);
    define(‘WP_SITEURL’, ‘http://sitename.com’);

    at wp-config.php, have help me to access my WP again.

    It makes my brain back cool again.

    Thankyou Bro.

    Reply
  89. mic says

    May 21, 2014 at 10:16 am

    Hi there, please i will need your help in getting back my site. i changed the url just like the other guys and i cant get back into the admin, Also the site is not what it should be looking like… …please help!!!!!!

    i tryed this as suggested.. ….. SITENAME.com/wp-config.php/ to the site name and nothing showed up…. .. it was blank… please if you can help that will be fantastic. . my email is mud-adio@hotmail.com. please email with the easiest and quickest way to get back my site. thanks

    Reply
  90. Alex says

    July 11, 2014 at 8:28 am

    Hi my site was installed as http://certivintrainingandassessment.com.au I really would like it to be http://www.certivintrainingandassessment.com.au is there any way I can change this easily. I new to WP and do not want break the site as it is an educational site.

    Regards

    Alex

    Reply
    • Blake Imeson says

      July 11, 2014 at 8:41 am

      Just adding the www you mean?

      That can be added in the Settings>>General no problem and shouldn’t break anything.
      You may want to make sure your DNS has a record for www but almost for sure it would.

      Reply
  91. WTB says

    August 1, 2014 at 11:38 am

    4 years later and still saving the day! Thanks a lot :).

    Reply
  92. Brandy Shea says

    September 17, 2014 at 6:43 pm

    What a relief! Ginormous thanks to you for posting this!

    Reply
  93. Italienischkurse Muenchen says

    October 29, 2014 at 6:55 am

    pfui! this was close.
    Thank you!

    Reply
  94. kim says

    November 3, 2014 at 1:21 am

    Plz help. I mistakenly put https://. On my url and saved it. Now I can’t login to my admin account. Page displays ssl connection error. What do I do now. Plz helppppp. I don’t understand Wt ftp is or how do I find it. I am very new to this. I was making my first word press website.

    Reply
  95. Sharon says

    January 28, 2015 at 7:40 pm

    Saved! Thank you :)

    Reply
  96. martin says

    February 8, 2015 at 11:43 am

    very thanks

    Reply
  97. Stephen says

    March 14, 2015 at 12:28 am

    My goodness thank you! I was thinking it would take me weeks or result in me having to pay someone to help me fix it. This saved the day.

    Reply
  98. Smitten says

    April 9, 2015 at 2:37 pm

    Hi,

    I have accidentally changed both URLs from http://smitten.a2hosted.com to http://www.projectsmitten.com

    Now I have tried your method on the functions.php file and am able to log in. However the big problem is now accessing the site (http://smitten.a2hosted.com) takes super slow to load, also the layout is all messed up. Am I missing something?

    Hope for your quick reply. Thank you.

    Kind Regards,
    Smitten

    Reply
    • Blake Imeson says

      April 9, 2015 at 2:49 pm

      Looks like that other URL is still in there.

      Are you able to add this to your wp-config.php file?

      define(‘WP_HOME’, ‘http://smitten.a2hosted.com’);
      define(‘WP_SITEURL’, ‘http://smitten.a2hosted.com’);

      Reply
  99. Jacob Dix says

    April 15, 2015 at 4:22 am

    So I’ve been helping a friend with his website. Knowing Google likes https more than http, I suggested he use the Yoast SEO plugin to force https. But he couldn’t find that feature, so in Yoast, in the file editor there I guess, he added an S to one of the http addresses.

    I’m slapping my forehead. This is beyond me. He can’t log in via http://www.site.net/wp-login.php. And logging in via an htp client just comes up with errors, so that I can’t go in and find the file he changed.

    I have no access to phpMyAdmin, and I doubt he even knows what that is. Any help?

    Reply
  100. Justin says

    May 4, 2015 at 11:12 am

    Blake, you’re a gentleman and a hero, I really can’t thank you enough for the solutions you’ve provided us here.

    After making the changes you suggested almost everything is working great, however I’m having one strange, lingering issue that I can’t seem to figure out:

    For some reason when I go to http://www.tvaccess.com the bullet points on my front page are displaying incorrectly (sort of like a missing font or something)… but when I go to http://tvaccess.com the bullet points look normal and display properly. This wasn’t an issue prior to updating the wp-config file and I’m at a loss as to what the solution might be. Any ideas??

    Thanks again!

    Reply
  101. Silviu says

    May 11, 2015 at 2:02 am

    Tried both methods and it’s not working. Also it isn’t a cache problem of the browser? And ideas?

    Reply
  102. Steve says

    May 23, 2015 at 2:50 am

    As it’s been stated, you’re a gentlemen and a scholar. I’m a WordPress plebeian and fumbled by changing the WordPress Site Address. This article told me in human language how to fix it. I am in your debt (metaphorically).

    Reply
  103. Valerie says

    June 9, 2015 at 1:08 am

    Worked like magic! If I get an ssl will I need to change it back with the same method or will I be able to do it in the wp admin panel? I’ve began to use cloudflare which has a free ssl but apparently changed the settings too soon on a few sites.

    Reply
    • Blake Imeson says

      June 9, 2015 at 7:26 am

      With SSL you should be able to change between http and https in without locking yourself out.

      Cloudflare only secures traffic between them and the visitor, not between them and the server FYI

      Reply
  104. Madeline says

    June 24, 2015 at 2:07 am

    please help me. i just set up my blog tonight and have no clue what i am doing. i accidentally changed its name and now everytime i try to go to my admin site it redirects me to the site i accidentally changed it to. i tried the wp-config thing, but my file says “wp-config-sample.php” and so i think that might be different. please help me i have no idea what to do :(

    Reply
  105. Jess says

    July 2, 2015 at 3:10 am

    Hey, I’m reading all these instructions and I think I know what to do but what on earth is the FTP where all this begins apparently?

    I accidentally changed my url from science-bird.com to sciencebird.com. I am hosting with bluehost. I cannot access anything as I am always directed to sciencebird.com

    I’m an ecologist, not a backend IT person in the slightest. any help is appreciated. please email me.

    Reply
    • katie says

      February 13, 2017 at 3:01 pm

      Hey,did you ever get this figured out?
      I’m currently going through the same thing and also, all these technological words just have me stressing out more!

      Reply
  106. Gary says

    August 8, 2015 at 9:14 am

    What a lifesaver. Changing wp-config did not work work for me but adding the following to the top ‘theme/functions.php’ did.

    update_option(‘siteurl’,’http://localhost:8888/mysite/’);
    update_option(‘home’,’http://localhost:8888/mysite/’);

    Source: http://codex.wordpress.org/Changing_The_Site_URL

    Reply
  107. Simon W says

    October 9, 2015 at 5:54 am

    Thank you SO much for this.
    I a SO grateful…. you really have saved me from my car crash…

    Reply
  108. Rehman says

    October 21, 2015 at 6:19 am

    Great buddy, It helps me a lot. You saved me website and also me, thanks again

    Reply
  109. Amit says

    December 3, 2015 at 4:40 pm

    Thank you very much, i followed the below link that you have provided because i didn’t want those fields to become uneditable. I like getting in troubles ;) and people like you always get me out of trouble

    Reply
  110. betsy says

    October 11, 2016 at 9:06 pm

    YAY! Thank you! Years later, this post is still saving butts across the internet. :)

    Reply
  111. R. S. says

    November 1, 2016 at 1:20 am

    Life saver! I was panicking for a sec, came across this and within seconds I was back on track. Thanks man!

    Reply
  112. Sasha says

    November 1, 2016 at 4:19 am

    Blake, you are a lifesaver! Thank you so much for all your help!

    Reply
  113. Samuel says

    November 19, 2016 at 5:31 am

    Thanks, you saved my day

    Reply
  114. SusanE says

    November 27, 2016 at 10:15 am

    YOU SAVED MY LIFE TODAY. I truly thought my client’s site was gone forever after my stupid error. I was horrified but then went through the steps you provided. The heavens opened when the site was then there as before in all its glory. WHEW!! Thank you!

    Reply
  115. Steve says

    December 2, 2016 at 9:01 am

    Alternative solution without hardcoding anything, see below!
    —————–
    Say you accidentally changes site address from

    site.com
    to
    site.com/’blog’

    An Alternative Quick and easy fix to that proposed is:
    1)Open FTP program and go to your site
    2)create ‘blog’ directory where your site is situated.
    3)copy all wordpress folders/files to that directory
    4)now you can access your WP site again. (by going to site.com/’blog’)
    5)correct your change in the site address WP admin line
    6)Open FTP program
    7)copy all WP data back to original folder and WP should work again via site.com
    8)delete ‘blog’ folder
    9)everything works as before…

    good luck!

    Reply
  116. Sadi Kunduroglu says

    December 4, 2016 at 6:56 pm

    Lifesaver! Thanks

    Reply
  117. Luc says

    December 18, 2016 at 6:24 am

    Thanks. Wow. You just saved me from the scare of my life. Fixed it!!

    Reply
  118. Tim Shultz says

    January 2, 2017 at 11:34 pm

    Hi Blake, I have a new website that I had setup, its live but never been really used…we decided to change the domain for it so I thought that I could just enter the new domain in the domain entry in settings so that the new domain would load the site…It now does not load at all and I can’t access the admin!! My problem is not that I accidentally did it, I want to switch the domain but I assume that is not the correct way to do it? Should I go through the steps you gave to get it back and then do some other process for switching the domain? Or is there another way to just switch the domain?

    Reply
    • LimeCuda says

      January 3, 2017 at 4:07 pm

      You’d need your hosting account set up for the new domain. What this entails is quite varied depending on your host.

      You’d need the new domain to have its DNS pointed to the right hosting too.

      You’d also need to find/replace or migrate the site from being set up for one domain to another. The tool “BackupBuddy” by iThemes is an easy way to migrate.

      Reply
      • Tim Shultz says

        January 3, 2017 at 11:34 pm

        Thanks so much, we got it fixed!!

        Reply
  119. Y.seek says

    January 4, 2017 at 12:58 am

    when I got into this disaster, my head just became blank.
    It finally worked!

    Thanks!

    Reply
  120. florian says

    January 4, 2017 at 4:47 am

    …. thanks so much, with my webdesigner being on holidays you saved the day.

    Reply
  121. Sham says

    January 8, 2017 at 12:37 am

    It does not work with Addon Domains….

    Reply
  122. Lucas Conde says

    January 23, 2017 at 10:43 pm

    THANK YOU, THANK YOU, THANK YOU, Saved me a hundred times !!!

    Reply
  123. Johnathan says

    January 30, 2017 at 12:01 am

    Thank you! I was crapping my pants because this happened when I had a client.

    Reply
  124. Matthew Taylor says

    February 9, 2017 at 4:58 am

    Gahhh! I had a heart in throat moment just now; All I wanted to do was make my url with leading upper case to make it look nicer. I accidentally added an extra URL in both of these addresses, and the entire site crashed. (In the live environment.) Thanks for this fix, worked like a dream first time!

    Reply
  125. wael Haydar says

    February 12, 2017 at 11:10 am

    Dears,

    I have had the same issue today while trying to fix google ads home page problem but the redirect messed up the domain…

    after that I applied the mentioned tags to configuration file, every thing is fixed, even the wrong redirection from WP settings is not making problems, and the ads working just fine.

    but the domain will show https://plantico.org/?home/ where “?home” is just fake to make google able to access the homepage,

    I hope you have a fix for this issue without redirection which is causing lot of amateur like me get into this…

    thanks,
    Wael Haydar

    Reply
  126. Nea Salamina FC Ghana says

    February 18, 2017 at 7:39 pm

    I mistakenly changes my url from http://www.mightyroyalscf.com to neasalaminafc.gh.com and now I cannot access my site admin to reverse the change so please help .
    I change the to links so I cannot login to the site as admin

    Reply
  127. Jamie Otelsberg says

    March 9, 2017 at 11:51 am

    thanks so much! this is an older article but it saved the day for me :) – i would like to have a word with the folks at ForwardHq – https://forwardhq.com/ – i realize now that this company is either a sham, or they are just out of business since 2015. On their help docs, they say to change the site URL in wordpress settings from localhost to their generated address.. then it all went down hill from there. They should remove their site from the internet, they are doing a dis-service at this point.

    Reply
  128. Tanya says

    March 9, 2017 at 3:01 pm

    Hi, I stupidly changed the web-site address in both wordpress adress and web-site adress and now I can’t even login to wp-admin.. Hours of work lost:( Do you know how to fix it???

    Reply
  129. Victoria says

    March 23, 2017 at 4:59 pm

    OMG! I could kiss you right now, you totally saved my day i am forever greatful! THANK YOU SO MUCH <3 <3 <3

    Reply
  130. Tony says

    April 26, 2017 at 12:49 am

    OOOOOOMMMMMMGGGGGGG…. I had trouble with your method, but did it directly in the database which was really easy. Scroll down on this page to find it. I am a complete NEWB and small business owner that almost had a heart attack.

    https://codex.wordpress.org/Changing_The_Site_URL

    Reply
  131. Kalyan says

    May 13, 2017 at 6:24 pm

    This is really a very good post man. You totally saved me. Thank you so much.

    Reply
  132. Abdur Rahman says

    May 17, 2017 at 8:49 pm

    Hello !
    It totally worked.
    i thought I would be a goner but this post was so help.
    I personally thank you :)

    Reply
    • Brighton Basil says

      June 19, 2017 at 2:39 am

      I feel you man! I have just been rescured too.

      Reply
  133. Evan says

    June 16, 2017 at 2:23 pm

    Thank you so much! My site is back up and running again when I type in the url of my wp directory. However, I’m unable to redirect the url to my wp directory now, as it gives me a redirect error “ERR_TOO_MANY_REDIRECTS”. Any idea why it would be doing this?

    Reply
  134. Brighton Basil says

    June 19, 2017 at 2:41 am

    Oh, Thank you Blake! Your 7 years old post saved my *ss today! Bless.

    Reply
  135. CWTE Technologies says

    July 22, 2017 at 12:26 pm

    Man You’re The Hero!!! You Really Saved Me Big Time, I was Already About To Cry Hard, i thought I Totally Lost My Localhost Site. I was Already Thinking Of Starting Afresh. Thanks Bro…..

    Reply
  136. Dave Bell says

    September 3, 2017 at 5:51 pm

    I know this is an old question, but for anyone else who stumbles onto this page (like I did today), you can fix this is directly in the wp_options table of the WordPress database.

    In cPanel, open phpMyAdmin
    You should see the name of your WP database in the left column.
    Click the + sign to expand, then click the wp_options table.
    Look in the Option_Name column for: siteurl (usually on the first line). To the right of that you should see the http address that you may have accidentally changed. Double click and change it to what you want.
    Also look for the line with: home (for me it was on the second page, line 36) and fix that address.
    Remember that ‘home’ is the address you want your visitors to type, and ‘siteurl’ is the address of where the wordpress installation lives (often the same, but for some, the siteurl will include a subdirectory).

    Close the browser or clear your cache and see if things are back to normal (for me, it took about 5 minutes for things to sort themselves out in the background). The addresses in Settings->General should still correct again, and still editable.

    Reply
  137. Alexandre says

    September 12, 2017 at 9:18 pm

    Thanks man for the help ! You helped us to save a lot of time.

    Reply
  138. David Kahan says

    September 25, 2017 at 11:49 am

    Thanks man, this was a lifesaver!! Well explained

    Reply
  139. Donatas says

    October 2, 2017 at 10:07 am

    Thanks mate. Worked as charm and moved a stone form my heart.

    Reply
  140. Matthew says

    October 6, 2017 at 5:14 pm

    Dude, saved my bacon, my lettuce and my tomato
    I was all like /wrists

    Thank you

    Reply
  141. Christina says

    October 12, 2017 at 10:35 pm

    Thank you!!! Truly a lifesaver!

    Reply
  142. Dicky Finus says

    October 21, 2017 at 7:56 am

    What Should I do if I don’t know my ftp information??

    Reply
  143. Bryan M says

    October 23, 2017 at 7:29 am

    The function way allows you to change the domain back in WordPress.

    Reply
  144. Aisling says

    October 24, 2017 at 3:04 pm

    PHEW!!!! Thanks so much for the post.

    Reply
  145. Matt says

    November 29, 2017 at 5:34 am

    Thank you so much

    Reply
  146. Oñay Sheard says

    December 5, 2017 at 6:42 pm

    Over 7 years later and this post saved my life and potentially my job. Thank you so much for sharing your grief to help others.

    Reply
  147. Paul says

    December 19, 2017 at 1:35 am

    You Rock! I knew there was a fix for this (because i came across it a couple years ago when i did not need it), but i could not find it anywhere.

    Then i found this article – You Rock!!

    Reply
  148. Harmony Kent says

    January 8, 2018 at 5:58 am

    Thank you so much for saving my bacon! I totally broke my WordPress by changing this field by mistake, and I had no clue how to fix it. You showed me just what to do! Cannot thank you enough, lols. :)

    Reply
  149. Murali says

    January 11, 2018 at 1:13 pm

    amazing brother, just loved it .ufffffffffffff!
    THANK YOU :)

    Reply
  150. Rebecca Dargay says

    January 16, 2018 at 11:03 pm

    You saved my life! I had to go a little different route because I forgot I went through bluehost when I set everything up. Once I logged into my bluehost account, I found wp-config.php under File Manager then followed your super easy steps and wished for the best and it worked. Thank you for this super helpful steps. Glad I wasn’t alone in this.

    Reply
  151. Chris says

    January 22, 2018 at 4:20 am

    You saved my site today. This is very helpful.

    By the way, you have to add this right after <?php

    At first, I added these to the bottom of my wp-config.php and it won't load normal. Then I added after <?php. Worked immediately.

    'define('WP_HOME', 'http://www.replicawatchespro-blog.com&#039;);
    define('WP_SITEURL', 'http://www.replicawatchespro-blog.com&#039;);

    Thank you very much

    Reply
  152. Margot van Brakel says

    January 23, 2018 at 6:13 am

    Thanks, Blake! You saved my day with this post!

    Reply
  153. Hannah Erickson says

    February 7, 2018 at 4:23 pm

    OMG You just saved my butt. I was following a tutorial to duplicate a site to a subdomain for redesign purposes and it had me changing something in the site url. I thought it was strange but did it anyways and then couldn’t get in and everything was down.
    YOU SAVED THE DAY.
    Peace and blessings, peace and blessings.

    Reply
  154. Marc says

    February 11, 2018 at 8:47 pm

    I accidentally locked myself out while trying to set up https. The site is up just for learning how to use WP. I could have wiped the site and started over, but this is so much better.

    Thanks

    Reply
  155. Jools says

    February 26, 2018 at 5:52 pm

    Jezus…I was having a heart attack 10 minutes ago until I came across your site. Bookmarked! Thank you!!

    Reply
  156. claudio says

    February 28, 2018 at 8:59 pm

    Grande ! :)

    Reply
  157. Sebastian says

    March 5, 2018 at 7:02 pm

    THANK YOU SO MUCH!!!! AHHH!

    Saved my day! Thought I’d just screwed up a week’s worth of work (my fault for not backing up)!

    Reply
  158. Simon says

    March 7, 2018 at 9:22 am

    Here’s another life saved!

    Thanks for the post. Yes its a dumb mistake, but clearly plenty of us have made it! Glad I found this.

    Reply
  159. Atish Manala says

    March 24, 2018 at 11:39 am

    Thx a lot dude!!!! I too mistakenly changed my http to https which caused me a lot of trouble!!! Reading your post and executing it saved my website thx a lot dude!!! Carry on your good deeds👍👍

    Reply
  160. Tuhin says

    March 31, 2018 at 7:21 pm

    You are a hero!

    Reply
  161. Tuhin Subhra Polley says

    April 1, 2018 at 1:39 am

    do we have any other way to do that? because that makes the whole thing uneditable. how to make that editable again?

    Reply
    • LimeCuda says

      April 6, 2018 at 11:27 am

      To make that editable again you’d have to remove that code from wp-config.php – which is fine if you have fixed your database to be the right URL.

      I actually like to leave it in wp-config.php because the graying out makes it harder for someone to accidentally make the site inaccessible. If ever you migrate it is easy to just change the URL in wp-config.php

      Reply
  162. Jonathan says

    April 4, 2018 at 1:48 pm

    “Using FTP, open up the wp-config.php file found in the root of your website files, edit it with a notepad program.” Do you mean the .xml back-up download from WordPress?

    Reply
    • LimeCuda says

      April 6, 2018 at 11:28 am

      No, the actual wp-config.php file found at the root of your site.

      Just for safety, make a copy of that single file (or entire site if you like) so that if you need it for some reason you can roll back.

      Reply
  163. Gopal says

    May 4, 2018 at 11:58 am

    Blake Imeson is truly a helpful guy. I contacted him for this issue and he helped me through it over emails. Think about it this way..He took the time from his work and helped me..a complete random stranger on the internet through the issue… that frankly made me lose sleep! and left my clients fuming until I resolved it. Highly recommend him for being so kind, helpful, smart and approachable.

    Reply
  164. Iwuala Valentine says

    May 28, 2018 at 4:52 pm

    Thanks so much, you save a life bro.
    This issue made me felt like to cry.
    thanks so much

    Reply
  165. Juli Maxwell says

    June 27, 2018 at 3:23 pm

    I am still having issues after adding to the wp.config file. only part of the site restores but I have no pictures and only a bit of css… and I can’t get to the admin part of WordPress. I was using “localhost” and accidentally changed to a www. address to mess it up. How do i get admin back?

    Reply
  166. Sonali says

    June 28, 2018 at 7:24 am

    Hey Blake,

    You are like god!!! :)

    This post is very old but still it is very useful. Really Thanks. Accidentally I was also stuck in same problem and I used your trick.
    Many Many Thanks. :)

    Reply
  167. Gigamam says

    July 15, 2018 at 5:30 am

    We’re in 2018, and I made this mistake. I don’t have access to phpMyAdmin and file manager. The client doesn’t want to give credentials or try fixing this.
    Please, can someone suggest any other way for me? I’m in a WordPress quagmire now.

    Reply
  168. Franco Yong says

    July 16, 2018 at 5:06 am

    Hello Blake,
    Great article. To the point, exact and so easy to follow. And most importantly, the advice is sound and the suggested solution works.

    You have certainly helped so many faced with the same many impacted with the same challenges. You have certainly make my day.

    Warmest regards,

    Franco

    Reply
  169. Mike Ticehurst says

    July 28, 2018 at 4:32 am

    Thanks goodness for your experience. I thought that I had really messed up and was so relieved to find someone else had done exactly the same thing.

    Your code has worked fine and I am now back in business.

    Reply
  170. jollylama says

    July 28, 2018 at 4:06 pm

    Thanks a zillion!

    Reply
  171. Akash Tripathi says

    August 24, 2018 at 4:45 am

    Hi all,

    This thing worked. Although I have to update in my WP DB as well but it was a post which gave a clue to handle this situation.
    I really appreciate this post.
    Love from Akkistez.com

    Reply
  172. Julien says

    October 30, 2018 at 3:44 am

    Thanks :) You save my day

    Reply
  173. yashwant says

    November 23, 2018 at 5:19 am

    Wow. Working…. Very Very Thanks for Sharing………

    Reply
  174. Navi says

    November 24, 2018 at 4:43 pm

    Thanks you sooo so so very much, It was dam helpful. Great help.

    Reply
  175. Katie says

    December 29, 2018 at 5:20 pm

    I’m trying to fix this mistake and I FINALLY found the wp-config.php file and there is no place to define the site URL. I can’t find anything that looks like this:
    define(‘WP_HOME’, ‘http://sitename.com’);
    define(‘WP_SITEURL’, ‘http://sitename.com’);

    What am I missing??

    Reply
  176. brideandgroom says

    December 31, 2018 at 8:02 am

    Hi blake
    Thanks so much, you save a life bro.
    This issue made me felt like to cry.
    thanks so much

    Reply
  177. Serge says

    January 20, 2019 at 10:19 am

    This is amazing! First time I was able to re access my site without begging my friend to help. Thank you for this clear procedure!

    Actually, the reason I ended up with the problem in the first place is because I’ve been meaning to update/publish my new site. So I went to settings in WP and removed the /dev from both URLs hoping this would do the trick. Alas, it kicked me out from admin. That said, do you have a procedure on how to update the new site – so that I can once again do this on my own. Thanks!

    Reply
  178. Cosmic Blocks says

    February 7, 2019 at 1:46 am

    Really helpful Post. I was trying how to get out of this issue & your post helped me a lot.

    Thanks for sharing this Post…
    :)

    Reply
  179. Tayla says

    May 31, 2019 at 11:49 am

    I just did that!! And I’m panicking because I can’t seem to fix it.

    Reply
  180. Dallas Singer says

    June 7, 2019 at 8:13 am

    Blake you are some sort of internet Jesus.

    Thank you!

    Reply
  181. Arnaud says

    January 16, 2020 at 10:46 pm

    Thank you so much

    Reply
  182. Tahni says

    January 29, 2020 at 9:37 pm

    I did everything you said exactly!
    I can now access the Website, but it deleted the theme, all the pages except for the homepage, and everything! All I see now is the words that were on the homepage and that’s it…
    I also cannot sign into WordPress home anymore. It recognizes the info but just won’t let me in…
    Any idea why this happened, or if I can restore the theme to how it was, or even sign into WordPress…??
    Thank you :(

    Reply
  183. M. Usman says

    July 24, 2020 at 2:14 pm

    a good post for accidentally happening mishappens to any one!
    I added my part on it, if you ever work with localhost and do that, then goto to localhost/phpmyadmin -> goto your project database -> find wp_options -> there are first two fields on option_name column named as siteurl and home -> edit fields infront of this column and remove “s” front https
    look like: https://localhost/projectname/ to http://localhost/projectname/
    then hit GO, and enjoy.
    refresh your localhost/projectname/ page and its solved.

    Reply
  184. Nguyễn Trần Anh Nguyên says

    October 30, 2020 at 10:50 pm

    thank you so much, i thought it is unfixable
    i’m having this issue right now, i don’t have the host account, the company that host my website said this is too difficult to fix, it’s have been a few months now
    Is there any other way or i have to ask for the host account?

    Reply
  185. Michael Heidenreich says

    January 22, 2021 at 6:26 am

    Hi Blake,
    Thank you so muck for this!

    I am working on my own page and made a beautiful mistake as well…
    So how can I fully revert this mistake AND make WP and Site address changeable again in settings panel?

    Can you help me, please?

    Reply
    • LimeCuda says

      January 22, 2021 at 7:44 am

      First thing would be to use that wp-config.php line to get your site accessible again. They you could use a search-replace plugin to modify the database and change ALL the URLs from your original to the new. Whatever the site address shows needs to match where your WordPress site lives in reality.

      Reply
  186. ally says

    May 10, 2021 at 3:54 pm

    Thank u so much,u just safe my life:D

    Reply
  187. Yannick Mussche says

    December 9, 2021 at 6:30 am

    Hey Blake

    I just had this issue on my localhost. I thaught I was being smart by changing this url before i uploaded it to the server, but now i cannot reach it anymore on my localhost.

    So as your solutions dictates, I open wp-config.php and I add those two lines:
    define(‘WP_HOME’, ‘http://localhost/WenS/’);
    define(‘WP_SITEURL’, ‘http://localhost/WenS/’);
    though, it doesn’t do anything. Can you specify where exactly to add these lines in the file?

    Also, in my database, I changed the values in wp_options directly, both to
    https://localhost/WenS

    This also doesn’t help. I open localhost, click on ‘WenS’ and i get error page not found.

    What else can I do?

    Kr,

    Yannick

    Reply
  188. Yannick Mussche says

    December 9, 2021 at 7:48 am

    Hey Blake

    to my previous unchecked post, If the data is correct in wp-options, putting the extra info in the config files make it crash.

    kr,

    Yannick

    Reply
  189. Debby says

    January 25, 2022 at 11:58 am

    I’m a true rank beginner, and I’ve read through the comments and questions here, but I’m still struggling. I’ve been making updates to a personal website for a friend using free WordPress, and I don’t know how to access the various config files being discussed here, I think mainly because I just don’t understand how the site is hosted, exactly, and my friend is clueless as well.

    Anyway, I made the mistake being discussed here when my friend asked me to make the site private. Not knowing exactly what I was doing, I changed these two general settings while logged in using wp-admin (the site names originally began with “http” and I changed both to “https”). I saved the changes and then started getting 404 errors trying to access the site. I tabbed back over and changed them back and saved, but that didn’t work.

    Being new to all this, I really don’t understand where these config files are located, nor how to use the various tools being discussed. Am I completely screwed? Thanks for any advice anyone can spare.

    Reply
    • LimeCuda says

      January 25, 2022 at 2:22 pm

      @Debby – do you know what hosting service they are using? That would be a good start. Often there is a “cPanel” or similar you can access to start the journey towards fixing the error.

      Reply
      • Debby says

        January 25, 2022 at 2:51 pm

        Yes, I did a little more reading and am in the process of getting that information now. My friend told me GoDaddy is used to host the site, so I’m waiting on her to give me the login credentials now. I appreciate your quick response and willingness to help. Looks like this post has saved a lot of people, so I know I’m in good company! ;)

        P.S. I saw in your bio you are interested in Austrian Economics, as am I. Big fan of Saifedean Ammous. Read The Bitcoin Standard a while back, now reading his latest The Fiat Standard.

        Reply
        • Blake Imeson says

          January 25, 2022 at 3:36 pm

          Wonderful. Glad you are on your way to figuring it out!
          I have had good experience with GoDaddy phone tech support – you may end up needing that. Probably you just need FTP access or some sort of File Manager access to then make that change to wp-config.php

          Yes! Love the Austrian school of Econ. Haven’t read anything by Saifedean but I am a big fan of cryptocurrency, so I’m sure both those books are right up my alley!

          Reply
          • Debby says

            February 1, 2022 at 3:22 pm

            Hi Blake,
            Finally got my GoDaddy access and was able to fix the problem, thanks to all your help. You are so generous with your time, and I appreciate it. I’ll send you a hard copy of The Bitcoin Standard if you’ll PM me your mailing address. You’re a good sort!

Leave a Reply Cancel reply

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

Footer

Blog Categories

Blog Archives

Blog Topics

.com 2.7 2008 addons AlphaLab Amazon applications apps April Fools autodidactic backup bailouts Blogging blogs bootstrapping CMS college CSS Del.icio.us efficiency email Entrepreneurship Facebook Firefox Gmail Google Google Apps Grove City College internet entrepreneurship LinkedIn links PCPGH3 plugins reputation management RSS SEO Seth Godin shared Social Bookmarking Social Media technology themes website Wikipedia WordPress

Copyleft © 2008–2023 Blake Imeson · Powered by WordPress of course

  • Home
  • LimeCuda.com
  • LimeCuda Portfolio
  • FewerThanThree.com
  • Sitemap

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.