Change the WordPress Address (URL) manually with the database

Instructions to follow if the WordPress site URLs changed (in Settings > General) and impossibility to access the site.

Notes: All the text in italics has to be adapted to your configuration, the names in italics are explicit to know with what to replace them with.

  1. Connection to the database : mysql -u hostname -p;
  2. Access to the table used by your website : use table_wordpress;

The URLs address are stored in the wp_options table (they are located on the first two lines of the wp_options table) :

  1. To change the WordPress address (URL) : update wp_options set option_value = ‘urlOrigine’ where option_name = ‘siteurl’;
  2. To change the site address (URL) : update wp_options set option_value = ‘urlOrigine’ where option_name = ‘home’;