Search code examples
phpmysqlwordpressdomain-name

Can't access wp-admin after domain change


I can't access my /wp-admin page after changing domains.

My nameservers and SQL databases still the same, only the domain name has changed. My old domain is pointing to the new one, which causes the new pages to redirect to the home page.

Google has not helped, and this question doesn't seem to have been asked yet, so I'm hoping to hear ideas from the wordpress geniuses out there.


Solution

  • If you are having that problem, most likely there will be other problems too relating to access to files and other assets for your site after a domain change.

    Here's what you can do:

    a) dump your existing database to sql (ex. dump.sql )
    b) using a text editor, open dump.sql from a) and change all instances of old_domain to new_domain (where old_domain stands for the address or name of your old domain, and new_domain stands for the address or name of your new domain )
    c) save dump.sql after changes in b) has been made
    d) delete/purge your database, and use file in c) to recreate your database.

    /wp-admin will return to you as well as other missing files/references in your wordpress site from your old domain.

    Good luck!
    -Glenn