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

I have change the main URL of my wordpress theme.
I accessed Admin area => Settings => and change my URL from :
www.sampleURL.com to www.sampleURL.com/?page_id=2

and now every time I enter www.sampleURL.com/wp-admin i get directed to www.sampleURL.com/?page_id=2

Read More

Please help!

Related posts

Leave a Reply

1 comment

  1. 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.