Changed domain in WP, now can't access site to change it back to Local's site domain

Long story short, I changed my site’s URL in the WP settings to something different from the URL in Local. Now I’m unable to access my WP site to change the URL back since the server can’t be found.

Basically, I’m experiencing an issue with Elementor and have been trying to troubleshoot it. One suggestion was to make sure the URL in WP’s backend is the same as Local’s ‘Site domain’. I don’t currently have a domain—I’ll migrate the website to an existing domain later—so the ‘Site domain’ is something like ‘website-name.local’, while the domain in WP’s backend is ‘http://website-name.com’.

As they aren’t the same, I figured that might be causing the Elementor issue. So while trying to troubleshoot, I added “.local” to the domain in WP’s settings so it became ‘http://website-name.local.com’. Didn’t work; it automatically reloaded the page and gave me an error message saying ‘Safari can’t find the server’. I tried going back a page in hopes it would undo what I did but changing the URL logged me out. It gives me the chance to log back in but when I do, it shows the same server error message. When I open the site using Local’s ‘WP Admin’ button, it opens to a 502 request error.

When on the log in screen I just mentioned, there’s a button saying ‘<- Go to Website Name’. When I click on it it shows me my home page, but as HTML only so no CSS, and no way to actually log in to WP admin.

Is there a way to change the URL in the code? Is my site lost?

Hi @isabellefr

A quick fix should be to change your Router Mode to Localhost which will force your domain to change to something like localhost:3001 and then you’ll be able to get logged back into the WP Admin with your same credentials. Localhost has some limitations like only being able to use HTTP and blocks Live Links access, but you could proceed there. To get back to where you were you could change your Router Mode back to Site Domains and click Fix It if Local wants to change your domains, it should reset them for you automatically.

Hi @Nick-B,

I just tried changing my Router Mode to Localhost and unfortunately it didn’t work, I still got the ‘Safari can’t find server’ error message. But I found a WordPress help doc that explains how to manually change the URL by adding in the correct URL in wp.config.php and it worked! I’m not able to change the URL in WP admin’s settings anymore because the code overrides it, but at least I’m able to access the site.

I would have preferred changing the URL back through WP admin instead of editing wp.config.php, but I couldn’t find another way so I’m glad it worked. Let me know if you or someone else knows of a better way!

1 Like

Glad to hear that worked for you @isabellefr! Those are probably the easiest ways to fix things up short of re-importing your site. I tested my workflow before responding and was able to get things working again but there may have still been some hangup with Safari or elsewhere.

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.