0

When I configured my WordPress, the WordPress URL and Site Address URL were different, lets say my WordPress URL was http://user99.com and my site address URL was http://user99.com/blog but yesterday while experimenting something in General Settings, I made both the fields same by clearing the field meant for Site Address URL and inputting the Site Address URL as WordPress's URL.

Now all my previous posts, which were previously in the previous URL of site address were lost and when I go to that site, the it says the site can't be found. So is there any corrective action need to taken to recover my old posts?

2 Answers 2

1

To fix your problem, you need either, phpMyAdmin or FTP access to your site.

phpMyAdmin method

Open your database and select wp_options table. Locate row with option_name = 'siteurl'. Click on Edit. In option_value field enter http://user99.com. Click Go button to save it. Repeat this for option_name = 'home'. Exit phpMyAdmin and go to http://user99.com/wp-admin/.

FTP method

Connect to your site with your favourite FTP client. Download your wp-config.php file. Edit this file by adding define( 'RELOCATE', true ); line, just before /* That's all, stop editing! */ comment line. Save and upload it back to your site. Go to http://user99.com/wp-login.php. Login as usual. Go to Dashboard -> Settings -> General and change WordPress Address (URL) and Site Address (URL) fields, to their correct values. Now you can remove or comment out define( 'RELOCATE', true ); line in wp-config.php.

0

I guess your WordPress is installed in folder blog and when changing the site url to http://user99.com WP lost its actual path. So if can access wp-config.php and add the following two line your issue should be solved.

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

EDIT As Frank P. Walentynowicz corrected me this will permanently change your addresses and the standard WP settings for site url and home url will be disabled so it is better to use Frank's method for editing the Database.

2
  • You have it backwards. His 'siteurl' is http://user99.com and 'home' is http://user99.com/blog. These defines will allow him to regain access to the site, true, but this method is not recommended, because, he will not be able to edit those urls in Settings, anymore. Commented May 7, 2017 at 10:01
  • Correction: by 'These defines' I mean defines with correct urls. Commented May 7, 2017 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.