Title: Bug? WordPress User Search Function breaks site
Last modified: July 5, 2018

---

# Bug? WordPress User Search Function breaks site

 *  [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/bug-wordpress-user-search-function-breaks-site/)
 * I encountered a very strange problem. I have a membership site with ~500 users.
   I am site admin. A user was having difficulty accessing the site, so I logged
   in and to find that user, entered part of the username into the “Search Users”
   field on the “All Users” page. I got a slow response and then was logged out,
   only to find the entire site trashed. Literally – the user database was completely
   wiped, and all posts/pages had been moved to trash — and who knows what other
   settings might have been messed up.
 * (I could verify this because I do have FTP access, so I was able to create a 
   new admin account for myself to log into the Dashboard and see what the problem
   was).
 * At first, I thought that the site had somehow been hacked, but I did a restore
   from backup, and repeated the same search — and the same thing happened again.
   No other signs of hacking, so I’m pretty sure that whatever happened was caused
   by some sort of glitch in the search function.
 * I don’t need help with my site because I simply restored from backup again — 
   but now I am afraid to use the “Search Users” function again on any site. It 
   could have course be due to a problem specific to that site – such as a theme
   or conflict plugin, or a corrupt entry in the database causing the search to 
   fail.
 * But I wanted to share this in case it is a bug and if anyone else has experienced
   anything similar.
 * Also, I would like help understanding what happened and why. That is, why didn’t
   a problem with the search simply result in an error message? Why would a search
   problem result in the entire user database being wiped? And when the user database
   was wiped, why were all posts & pages moved to trash?
 * The site is running the WordPress 4.9.7; PHP v. 7.1.19
    I don’t see anything 
   in the PHP error logs. I ran a Wordfence scan and it came up clean — so no sign
   of malware on the site.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 11 months ago](https://wordpress.org/support/topic/bug-wordpress-user-search-function-breaks-site/#post-10467572)
 * Via PHPMYADMIN, run a check on all your tables. Maybe on is not corrupt enough
   not to let you login, but causes really bad stuff to happen when you search through
   it.
 *  Thread Starter [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/bug-wordpress-user-search-function-breaks-site/#post-10467591)
 * After I restored from backup I ran both optimize & repair– so if there had been
   a problem, it would have been fixed. (I did run “check” again just to verify).
 * So yes, corrupt database seems the most likely reason for a problem when running
   a search query…. but that still doesn’t explain why I would see posts & pages
   trashed. Or would that be something that wordpress would do automatically in 
   response to the deletion of all active user accounts?
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 11 months ago](https://wordpress.org/support/topic/bug-wordpress-user-search-function-breaks-site/#post-10467672)
 * > . Or would that be something that wordpress would do automatically in response
   > to the deletion of all active user accounts?
 * No, but the posts and pages are part of the database, so… that’s what I was thinking.
 *  Thread Starter [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/bug-wordpress-user-search-function-breaks-site/#post-10467919)
 * But it’s not as if all of the posts/pages simply were corrupted. Rather, they
   were moved to trash — so the site worked, but just came up with a “not found”
   error. (Not the server error, but the page within the theme that showed the error).
   Menu settings were also messed up (so theme displayed, but not the regular nav
   menu). And all posts/pages were still there and could be bulk-restored from trash.(
   I played around a little with the backend functions before doing the full restore
   from backup)
 * So basically there was a cascade of problems/issues triggered by a search, which
   affected more than the table that was searched.
 * I checked the mysql error log for the site, and nothing showed up there. And 
   nothing in the PHP error log.
 * Anyway, for now it remains a mystery. Just one more reason that it’s a good idea
   to regularly backup all sites. I’m feeling shy about using that search function
   again — but if I do I’ll turn on “debug” first and see if that provides information
   and post again if the error recurs.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Bug? WordPress User Search Function breaks site’ is closed to new replies.

## Tags

 * [user search](https://wordpress.org/support/topic-tag/user-search/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Abigailm](https://wordpress.org/support/users/abigailm/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/bug-wordpress-user-search-function-breaks-site/#post-10467919)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
