Lost WordPress website access after changing URL [closed]

If you have a cPanel and have an access of phpMyAdmin on your host, then find your DB, check the “siteurl” and “home” fields are correct in wp_options Table.

Or

Add these two lines to your wp-config.php, where “example.com” is the correct location of your site.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Or

If you have a cli access, then login into your Mysql, select a database and run below query

UPDATE wp_options SET option_value = replace( option_value, 'http://oldsite.com/path', 'http://spankingnew.com/otherpath' )
WHERE option_name="home" OR option_name="siteurl";

(NOTE: make sure to change ‘http://oldsite.com/path‘ with your correct URL and ‘http://spankingnew.com/otherpath‘ with your edited URL in the query)