local wp-admin login page redirects to live production server instead of local backend

I just successfully connected my first locally-hosted website to a copy of its production database, but when I try to log in to the backend, it redirects me to my production environment. Why?

The solution is to fire up myPhpAdmin, open the wp_options tables (or yourWPprefix_options table) and change the entries in the first two lines of the table. Replace the production URL with the local URL.

Screenshot from myPhpAdmin running in browser

In myPhpAdmin, you can either click the “edit” button at the left, or double-click the text you want to change. In our case, “http://www.freshangle.eu”. Here is the table after replacing these two values:

Screenshot from myPhpAdmin running in browser

Now, when I add /wp-admin/ to my home URL, it opens up the backend on my local computer instead of sending me back off to production.

Here’s a screenshot of me logged in to my local backend, not the production one anymore:

Screenshot of my local WordPress backend, logged in on my browser

This is exactly what I need: I can now update WordPress and plugins, test plugins out, all on my local computer. It won’t affect the production server at all. After I’ve tested things out, I can either go repeat the final update sequence on my production server directly, or simply push the final changes up from my local repository through git.