I went to Network Admin > Sites > clicked on a site and changed the site url for a child site. Now that site is gone altogether and I cannot get it back. What can I do now?



Notice, how drop defaults to false; this means that the blog tables are not removed. Deleting is triggered from over here: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-admin/ms-delete-site.php#L19 and nowhere else by default. Unless you have a plugin that forces drops on the tables there's still a chance to recover something.

First of all backup the database before attempting anything.

To get the blog to be displayed in the list you have to reverse the following action:

update_blog_status( $blog_id, 'deleted', 1 );

You can do this manually via MySQL:

UPDATE `wp_blogs` SET `deleted` = 0 WHERE `blog_id` = '##'

Or update_blog_status( ##, 'deleted', 0 ); in your functions.php once.

The users will, unfortunately be gone, due to this in a loop:

remove_user_from_blog( $user_id, $blog_id );

...performing even if the tables aren't dropped.

The rest - settings, files, etc. should be all intact.

Good luck.

  • The SQL did not work. In table wp-blogs there is nothing with deleted=1. I did find all the page content in the table wp_4_posts. – Vyom Mar 31 '12 at 18:55
  • If you see and understand that the tables for the blog are empty or non-existent - then, unfortunately, without some sort of backup everything is lost. – soulseekah Mar 31 '12 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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