I can’t access my admin page after changing main url

Not sure why you would want to make that change, but if worst comes to worst, you can change it back via the database. Assuming you can access your MySQL database directly, simple navigate to the wp_options table and change the value of siteurl and/or home to your desired values.

EDIT: Alternatively, if you can access your code, in the theme’s functions.php file, add the following code.

update_option( 'siteurl', 'http://sampleURL.com' );
update_option( 'home', 'http://sampleURL.com' );

Obviously, swap http://sampleURL.com with your URL. Then refresh the home page of your site a couple times. Once everything is back to normal, remove this code.

Leave a Comment