简体   繁体   中英

changed wordpress URL and now no access

My first time using WordPress and I was asked to make some changes so I made some changes and there was a problem with the redirecting so I went to the settings in the admin page and changed the WordPress URL. As soon as I saved that, it logged me out and I don't have access to the site. All I have is the admin username and password. Is there any way that I can access the WordPress URL and change it back? For example, it was, "website.com", I changed it to "website.com/home-3"

Try this:

Find the IP address of the site in question. You can do this here: https://www.site24x7.com/ping-test.html

In the results screen, it'll show you the site's IP address.

Now, you'll want to add this IP address and whatever you changed the URL to to your computer's hosts file. A line something like this probably:

12.123.123.123 www.mistake.com

Where 12.123.123.123 is the IP address you found in step 1 above. Save the hosts file.

Here's a guide on editing your hosts file, depending on what OS you use:

http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

After doing this, you should be able to get back to your site's wp-admin address and fix that error. You may need to refresh a few times so your computer picks up the changes you made to the hosts file. If you're on Windows you can run ipconfig /flushdns from the command line and that'll speed things up. I'm sure there's something similar in MacOS

@Hamza if you are still locked out, here is a good way to resolve this.

If you have admin access to the site via FTP, this method will help you quickly get a site back up and running.

  1. FTP to the server, and get a copy of the active theme's functions.php file. You're going to edit it in a simple text editor and upload it back to the site.

  2. Add these two lines to the file (use your own URL or IP instead of example.com, obviously), immediately after the initial php line.

update_option( 'siteurl', ' http://example.com ' );

update_option( 'home', ' http://example.com ' );

  1. Upload the file back to your site, in the same location.

  2. Load the login or admin page a couple of times. The site should come back up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM