Local site redirecting to Live site

I’m trying to do some work on local for a site that keeps taking me back to the live version of it. I’ve updated the database options for home and siteurl, along with the actions shown on this post:


Results: It either doesn’t connect to anything at all or it redirects me to the live site. I’m totally lost on this one and would appreciate any help I can get.


Did you fully scrub your database when you imported into local from live? Any page links, image links etc will be stored using the full original URL hence swinging you back to the live site.

You’ll need to run a sQL script to make the mods. Something like:- https://gist.github.com/chuckreynolds/6032234

Note, if you migrate back to live don’t forget to re-run the script on live. I’ve had cases where the live site is referencing my local site. OK for me but fails for everybody else: School boy error.


I am experiencing the same problem. I did a copy of the entire live website (updraft backup) and then created a new site through flywheel. then I downloaded the updraft plugin on the local site and then uploaded the backup from the live.

I had already built some of the website out live, but there are internet issues all the time, so i moved it to local. but right now its redirecting to the live site (which has internet/connectivity/server issues) so i am trying to fix my local copy so it doesnt redirect to the live site.

before i restored the database, through updraft plugin, it did say that it looked like a migration not a restoration when i did it on the local. ??

i followed your link but dont understand how to use the sql code. some help please.

or at the very least, how can i undo what i did with the local site while not messing up my live site. can i just delete the site from flywheel and then start over?

1 Like