Restore WordPress Site

go to wordpress directory via ssh and modify wp-config.php including 2 new string on bottom of file

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

enter on mysql query by this command on ssh

mysql -u 'dbuser' -p 'dbname'
enter password 'dbuser'

now on mysql> type this command to find the actually location of suteurl and home url

SELECT * FROM wp_options WHERE option_name = 'home';
SELECT * FROM wp_options WHERE option_name = 'siteurl';

modify this url by typing the following command:

UPDATE wp_options SET option_value="http://example.com" WHERE option_name = "home";
UPDATE wp_options SET option_value="http://example.com" WHERE option_name = "siteurl";

exit from mysql and reboot server

Screma

davide Written by: