
One of the common WordPress errors is having a problem accessing WordPress after changing the site URL on the WordPress general settings page.
The first thing you need to know is that you’re not the first or the only one to have this issue, almost all beginners will have this issue too.
In this guide, I will show you how you can fix the problem and how to change your WordPress site URL in order to be able to access your WordPress Admin again.
The reason why you cannot change the website URL again is that the page where you can change the URL again is not in the right location. As you changed the site URL, all website URLs have been updated to the new one including the URL of the General settings page where you can change the URL.
But the actual location of WordPress files is still in the old location, so when you try to visit WordPress admin URL you actually requesting a page that does not exist.
To solve the “Can’t access WordPress after changing site URL” error you simply need to change the website URL and restore the old URL.
How to Manually Change WordPress Site URL
To change the WordPress site URL you need to do it manually as you can’t do it from your WordPress admin panel. That is possible via 4 methods, the easiest two of them are:
- Changing The WordPress site URL by editing the
wp-config.php
file. - Changing the WordPress URL via phpMyAdmin.
Fix #1: Changing the WordPress Site URL by Editing the wp-config.php file
This fix solves the problem by adding two lines of code to the WordPress configuration file ‘wp-onfig.php’.
To do so you will need to have access to your WordPress hosting panel or FTP access in order to be able to edit your wp-config.php
file.
After adding the code and saving the changes to the file you will regain access to your WordPress site and you will be able to log in to the admin area as usual.
However, this method is not the best practice.
What it does is hard-coding the site URL into the code of WordPress itself. Thus, it will not be possible to change the WordPress site URL on the WP admin panel’s General settings page anymore if you are using this method.
Step 1:
Login to your WordPress hosting cPanel.
Under the Files section, click on File Manager.

Step 2:
Open File Manager and search for a file called wp-config.php
and click on “Edit file”.

Step 3:
Add the following two lines of code to the top of the wp-config.php
file after replacing https://www.example.com
with your site URL, then save the file.
define('WP_SITEURL', 'https://www.example.com');
define('WP_HOME', 'https://www.example.com');
That’s all, try accessing your WordPress Admin panel now.
Note:
If you don’t have cPanel, you can use FTP to edit the wp-config.php file. Or you can follow the second fix to change the WordPress URL via phpMyAdmin.
Fix #2: Changing WordPress site URL via phpMyAdmin
The second method to change the WordPress URL and fix the “Can’t access WordPress after changing site URL” problem is to manually change the site URL value in the WordPress database.
This can be easily done using phpMyAdmin which most WordPress hosting providers offer for free and comes bundled with cPanel.
If your host doesn’t have phpMyAdmin you can use their alternative online database administration tool.
Moreover, if for any reason you can’t use phpMyAdmin you may use it’s lightweight, yet powerful alternative Adminer that comes in as a single PHP file.
This method is the recommended way to regain access to your WordPress site if you are not able to log in to the WordPress admin panel.
To do this follow these steps:
Be Aware!
Editing the WordPress database directly could easily break your website if not done correctly. So, if you can’t do it hire a developer.
And always make sure to take a backup of your database before editing it.
Step 1:
Login to your hosting cPanel and open phpMyAdmin.

Step 2:
Select the database of your WordPress site from the left sidebar.

Step 3:
Select “wp_options” table
Note: “wp_” prefix may differ depending on your WordPress installation settings.

Step 4:
On the right, click Edit beside either the siteurl or home entries.

Step 5:
Enter the correct values in the option_value
fields, then click Go.

Step 6:
There is no step 6 🙂
Go ahead and try to access your WordPress site and log in to the WP Admin panel.
Conclusion
Now I’ve covered the two easiest methods to manually change your WordPress site URL.
They will help you regain access to your website and the WP Admin dashboard if you can’t access it after changing the WordPress site URL.
If none of the methods could help you fix the problem or just want to say hi! don’t hesitate to let us know in the comments below.
Thanks greatly. I thought I had stuffed up my website and would not be able to get back in. Accessing the database using AdminPHP like you said – absolutely saved me. So thank you for putting great information online.
So – I don’t suppose you are online and able to help me with another question (which I was trying to naively work on when I crashed my website).
Whatever static home page I select – will not display at all in incognito mode if I try open either the website or the particular page directly – but all other pages do. And if I change the home page to a different one – then that one won’t display.
Hi Peter,
Glad you could restore your website.
Regarding the incognito problem, you didn’t mention enough info to help us investigate the problem.
However, it seems that you have a ‘coming-soon’ page plugin, as such plugins display a custom page for logged out users (incognito mode).
So, if you have finished setting your website up and are ready to publish your website to all visitors, look for the coming soon option in WordPress Admin dashboard or web hosting control panel and disable the coming soon page.
FYI: your website’s homepage is currently set to the page with ID: 221 and it is designed with Elementor website builder.
I have tried both methods but still the issue not fixed and I’m unable to access my wordpress site. kindly provide any helpful solution.
Site UBL is ***
Hey Rizwan,
Your website and login page is currently working on our end.
It might be a caching issue in your browser or DNS.
Try clearing browser cache and flush your OS’s DNS cache.
Thank you for your simple, easy to follow directions….and beginning the post with encouragement for not being the only one to crash your own site. Followed your how-do directions and my site is FIXED!!
This was so helpful but unfortunately didn’t work for me- not sure what else I have done wrong. I can see the site URL updated in PHPmyAdmin, but I still cannot log into my WP admin.
If you have successfully updated the URL in the Database via phpMyAdmin and you still can’t access the admin dashboard, it is likely to be a cache issue.
Clear the caches and try again.
This is by far the best Guide to solving this problem…. I mean EVER!
Fix #2 worked just fine.
A big THANKS to you.
I recovered my site URL.. Thankyou
Thank you!!!
Fix #1 saved my wedding website!!!
Best regards to the moderators!!!
Any advice for being unable to access the files for the WordPress site? No cPanel, no phpMyAdmin, no nothing. I broke my client’s site by changing the URL in the general settings but I have no access to the host. It seems my client purchased her website from a less than trustworthy source and they are holding her files hostage. The nameservers are of no help either. Ever run into such an issue?
Hi Ryan,
You can try via FTP if you have FTP access or use a WordPress File Manager plugin like this one and this one.
Hi, what if we didnt write down the original website url to put in the correct value? how is it possible to find it
Hi Miguel,
Just enter the URL of the website and it should work.
Thank you very much, almost freaked out. This is why I love the internet b/c of helpful people like you
It worked! I made the classic beginners mistake described above. This tutorial saved my life! Thank you
HELP…still doesn’t work after doing the first method. My site doesn’t even appear in the bluehost panel when I go to “my sites” I don’t know why.
This problem appears to be related to your web hosting account.
Reach out to Bluehost’s live chat support and they will help you.
HELP PLEASE
Site was migrated using Duplicator Pro on my self hosted Linux server. When I type in the IP address of my server it loads everything correctly including the wp-dashboard. But since I changed the IP to my correct domain. the wp-login page and even the website itself just keeps loading without bring up the contents. Ive not been able to login into my wp-dashboard but it works perfectly if I use the IP.
Please help
It is most likely a DNS issue.
After migration, you should update DNS records to point to the new IP address.
Also, try clearing DNS Cache (DNS flush) and check if your domain name is pointing to the new IP address by running a ping test on your device or using any online tool.
the site was previously hosted on an hosting company before i decided to self host it on my Linux server.
I went to godaddy where I bought the domain name and pointed it to the static IP of my server earlier today.
But please how do I clear my DNS (DNS Flush) and how do I run the ping test so as to know where the problem is. because i’m really frustrated already
To flush DNS on Windows, open Command Prompt by typing CMD in Windows search.
In CMD, type:
ipconfig /flushdns
and hit enter.To run a ping test, open CMD, type
ping example.com
after replacingexample.com
with your website’s domain, and hit enter.You should now get a message like this “Pinging example.com [123.45.67.890]”.
If the IP is your new Linux server’s IP, then it is not a DNS issue, if not try waiting and flushing the DNS cache again or reach out to GoDaddy to fix the problem for you.
I hosted the server on Ubuntu or can i ping it on my other computer running windows?
The previous instructions are for the PC you can’t access the website from, not the hosting server.
Hi
I didnt ‘changeg anything but i noticed that everything was already OK but on the browser, I can’t access still acces to my website or dashboard of wordpress admin
Try accessing it from a different browser and clear the cache of the website, hosting, and browser.
Great Help
thanks man you save my website life
This worked to get my site back online, but I can’t log back into my admin panel (site is still down). I think I need to clear my hosting site’s cache, but if I can’t access my admin, how do I do this? Can I clear this manually through my FTP?
Glad to hear it worked for you.
Try reaching out to your hosting provider to help you clear the cache.
Thank you soo much.
I think moving the second (recommned option) up in the list would be helpful
i was all down for the first one and then I saw the second one
Thanks so much! This was a crisis saver.
Thank you so much for your explicit and detailed explanation. you are a good teacher.
I will bookmark your articles as it simplifies complex WP issues.
2 Thumbs up
I managed to get access to my website, but I can only view the home page, i cant view or edit any of the other pages….
Try clearing hosting cache and your browser’s cache as well.
YOU SAVED MY LIFE. I about had a heart attack while working on a clients website. This fixed it and saved me from having a meltdown.
Fantastic, cheers. I thought I had really screwed things up, but your instructions were very simple to follow.
Really thanks, I was really really troubled when I couldn’t access my admin area
Worked a treat, thank you! Interesting that the site now defaults to https when loading it from just the domain name, yet we had to change it back to http in the database to get it to properly load.
Hello Ahmed, THANK YOU VERY MUCH!
So after entering my website again – thanks for the help !
Now both WordPress Address (URL) and Site Address (URL) aren’t possible to type in.
Is it not possible to change it back – so I type in the old URL and remove the code from wp-config.php ??
Why would you remove the code if it solves the problem?
In order to remove the code without breaking your site again you need to change the values in the database using the other method first.
You are really a techie guy. I was trying to resolve this issue since a week after reading your blog this problem has been resolved within a minute.
I tried for the second method is not working then I use the first method but
I have a syntax error for the first method so I hold it …..
If you could send me help i will super appreciate
Did you use this PHP code?
define('WP_SITEURL', 'https://www.example.com');
define('WP_HOME', 'https://www.example.com');
I had a hard time with the first step. It actually turned my site into a bunch of texts when I tried it good thing I was able to find a YT vid to see what was originally written so I was able to restore it back. Lesson learned, next time take a screen shot first before changing anything so you can restore it to the way it was. The second step was easier and it was a success!! So thanks to your help I was able to get my site back!!
You saved my life! Thank you for creating such a comprehensive guide to undoing my rookie mistake!
I’m glad that I read through to actually see the recommended course of action. And it worked!
Hi Ahmed,
I thought I’d add another “last-thing-to-check” to your very well written solution. I recently got locked out of a WordPress site after a migration, and even when I changed the URL path using: phpMyAdmin, the site was still not functioning.
This was ultimately do to server caching on the hosting side! So you may want to add that to your instructions to let people know that the phpMyAdmin change “has” to work, and when it doesn’t it’s most likely your hosting company caching stuff on their server. 🙁
Stuff like this drives me crazy, and it’s just nice to share so others don’t pull their hair out LOL.
Have a great day!
You’re right.
Caching is known for driving people crazy especially developers, and the issue might persist even if it is solved on the DB level.
Thanks for your comment.
Thank you for this. After updating the site url and home url on phpMyAdmin, I couldn’t access the wp dashboard but could see all pages on the site. Clearing cache from the hosting provider resolved the issue immediately 🙂
Hello!
I did about the same mistake pointed up there, updated HTTPS in the site address in WordPress settings before updating the SSL certificate and now the admin page is not reachable.
However, I have used GCP for hosting and there is no cPanel there.
I want to update the site address via VM instances > SSH but don’t know the code syntax for it. Can you help?
Hi Annanya,
You don’t need cPanel to use FTP or phpMyAdmin.
They’re both free and can be used to fix the problem as explained above.
Try searching the internet for tutorials on how to access phpMyAdmin or how to use FTP on GCP.
Hi guys,
I still have the issue. I changed the URL in the WP Dashbaord and I can’t login now. I can’t get access to the Backend:( I have tried everything and I puttet so much work into it please help me!
Hi Elina,
Try reaching out to your web hosting provider and they should be able to solve the problem.
Hi . it was really helpful man , tnx a lot !
Thank you.. Thank you .. Thank you .. my friend, you really help me a lot. I thought I’m gonna lost my site. It is really great knowledge you gave me. Here it is my site is fixed. Really appreciate your effort to put up this kind of website and its content. Amazingly awesome. anyway if someone reading this still got a problem let me know shoot some email maybe I can help too.
Hi guys!
I know this is absolutely stupid what happened here, but oh well we all make mistakes.
Somebody setup my online shop for me and I DON’T have access to the cPanel.
I of course accidentally changed the above and now I can’t access the wp-admin page.
I hope not everything is lost and this can be done somehow without access to my hosting…. Please help
Hi Alex,
If you don’t have access to the WordPress admin dashboard or the hosting control panel, you are not different from any normal visitor of your website.
I’m afraid there is nothing that can be done by you or us to fix the problem.
The only way to solve this problem is to reach out to your host or to the person who has access to the hosting control panel.
Thank you so much, I thought I wrecked my site.
The second step with phpMyAdmin worked for me.
Cheers
thank youn so so much! was almost ready to give up before i came across this post, saved my day!
Thank you! this helped a lot. I have another related issue – i can now access my home page, but not the other pages (it showed the same error message i had when i tried to access my main page after changing site url).
Please help! thank you.
Hi Alicia,
Glad it helped you.
Unfortunately, you didn’t provide enough info about the problem.
This might be caused by the cache, try clearing all caches (host, WordPress, browser and DNS cache) and see if it works.
If the problem persists, reach out to your hosting provider, they will be able to help you fix the issue.
Someone used the WP admin and changed the Admin > Settings > WordPress Address (URL) which then killed the website.
Home dir = ~/public_html/myhome
WP dir = ~/public_html/myhome/wp
I had to hack into the WP MySql database, “options” table, and change the “siteurl” from
https://server.com
tohttps://server.com/wp
again and now it’s fine. Phew!!Hi I have the exact same problem I ve changed the URL and know everything I basically gone. No dashboard nothing! How did you solve the problem?
Hi!
I’m a newbie to WordPress. Thanks for the tips! The first one helps me to get into the admin page. (Finally!!!) But the problem is, now it’s extremely slow to log-in. Also, my website can’t properly be loaded. I guess there’s maybe the issue with the database? Also, I couldn’t download the phpMyAdmin after all.
By the way, I should mention how this all happened. I was accidentally setting both the Site URL and the WordPress URL to a wrong IP address. Is there any other way I can reset the URLs back to the localhost? Or I should just start over again since I have nothing really establish on my website. Tips appreciate!
Hey Hsiang-Yin,
Glad to hear you are now able to access the WordPress admin dashboard.
phpMyAdmin is free, opensource, and comes bundled with most local servers.
However, if you can’t use it you may use Adminer that comes as a single PHP script.
And after you successfully change the database entries, don’t forget to delete the two lines you added to the
wp-config.php
file.Regarding the speed, it is not related to this problem!
thank you so much….the first method saved me, I freaked out thinking I lost all my work.
Hi,
I have changed the url of website to add ‘www.’ via admin panel in wordpress, but it lead to dead site. so to revert back I used cpanel & changed the home & siteurl in database (via phpmyadmin).
It works & now i’m able to access my site admin, all pages except ‘HOME’ page. It still leading to dead end and showing url with ‘www.’ i.e.
http://www.example.com
.Please advise any solution.
Thanks, Ankur
Hey Ankur,
I’m glad to hear you could fix the problem.
What you are facing now is probably caused by cache.
Try clearing all your website’s cache and your browser’s cache as well.
Hello! I just went through this except I don’t have any of these solutions (cPanel, phpMyAdmin, FTP), so none of the methods above would work for me. My website is on a business plan and I really REALLY can’t afford to lose it. Please, PLEASE help.
Hey Merna,
We’ve replied to your message and we will follow with you from there.
Hello!
I have the same issue as Merna. Can’t access through any of these options. Literally have just my url. Pls help me!
Hi, Lucas,
I took a look at your website, and I believe you need to reach out to your hosting provider.
They will be able to fix the problem.
Hi, Thank you so much for this information. I could solve my problem before becoming a monkey 🙂 I am a beginner creating my own blog and am so happy to have found your site.
Hi none of these worked… Please help!!
Hey James,
Try reaching out to your hosting support and they should be able to fix it for you.
Hi,
I just tried doing this, and now I can’t sign in to WP-Admin, what can i do? I’ve tried also to change the url in my database, phpMyAdmin… And also tried via my web-host’s cPanel – Still can’t sign in.. Please help
Hey Jeanette,
Have you tried contacting your host’s support?
They should help you fix the problem.
I was totally out of my mind when I just messed with my newly formed wordpress website. The second option saved my efforts . Thank you
How can I get into my WordPress after changing domain and I didn’t have a host
Can you please explain what exactly the problem you have?
You can always log in to WordPress using this URL:
https://example.com/wp-admin/
wherehttps://example.com
is your WordPress site URL.thank you very much.
your site is very help full keep it up
When I tried to change my domain name to a new domain I purchased I was locked. I found out Hostgator is the host but I’m not the person who put my website together I just manage it so as I try to log in the correct I’m not able to I try to change it from ClaudetteMarks.org to ClaudetteMarks.com
I can see that your new domain is not pointed to your website (hosting) and is displaying the default GoDaddy page.
What you need to do before changing the WordPress site URL is to link the domain name to hosting first.
You can reach out to HostGator’s tech support and they can help you fix the problem.
We’re also going to reply to your email in order to maintain your privacy as comments are public.
Thank you so much for this! I thought I lost my website. The 2nd option worked like a charm! Thank you again.
Hi. I made my entire website at the location
www.mywebsite.com/wp-dir
. Now I realized that I don’t need wp-dir and removed that from the URL in the settings and lost everything. Using the methods listed above, I recovered my website but I realized that i could login using mywebsite.com/wp-dir but some of my pages are still at mywebsite.com.I ultimately want to use mywebsite.com and not with /wp-dir. How can I do that? Would appreciate your help. Thanks in advance.
Where exactly did you install WordPress? in
wp-dir
or in another directory ‘folder’?If you installed it in
wp-dir
, you need to move WordPress folders and files to thepublic_html
directory via FTP or using cPanel’s online filemanager.What if you have no cpanel? I cannot figure out how to access my files for wordpress…
If you want you can easily access your files via FTP by using a program like FileZilla FTP client.
But if you mean your WordPress website’s Database, you can use phpMyAdmin and install it on the hosting if it is not installed by the hosting provider.
Thank you SOOOOOOOooooooooooooooooo much!!
Amazing. I am so bad at wordpress and took me forever to put together my site (because I am so slow!)
I ruined it all because of editing the site url.
I am so glad that i am not the only one stupid enough to do this, and thankfully someone like you was kind enough to write up a simple and clear guide.
Thank you so much!
You are a life changer, I have no words to say you thank you.
Thank you very much.
YOU ARE A FRIGGEN SAINT!!!!!!!!! THANK YOU SOOOO MUCH FOR THIS POST.
After I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I recieve four emails with the
same comment. Is there a means you can remove me from that
service? Cheers!
Hi,
Your email
[email protected]
is not subscribed to WP-ME.com.It’s going to be end of mine day, except before end I am reading thіs wonderful piece оf writing to
increase my experience.