In case you do not have access to the WordPress admin dashboard, follow  these steps to change the URLs via the database: