WordPress Redirects to a cancelled domain, need to change it but can’t get to the admin portal

If you have access to the database, go into the wp-options table and change the two instances of www.olddomain.com to www.newdomain.com .

You should be able to log into the admin area then.

Then use a Search and Replace plugin (I like “Better Search and Replace”) to change all instances of www.olddomain.com to www.newdomain.com ) . That is required to ensure that internal links (especially to media files) will work.

Of course, a backup of your database is always a good idea.