Title: Debugging hacked site
Last modified: February 28, 2020

---

# Debugging hacked site

 *  Resolved [thomtddg](https://wordpress.org/support/users/thomtddg/)
 * (@thomtddg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/)
 * Hello,
 * I’m having some problems fixing a hacked wordpress website.
    So this site got
   hacked, and was full of spam and links to other websites. I got it managed to
   work again, and changed the passwords, disabled the theme and all the plugins.
   The only thing I couldn’t do was entering the admin area: I got a critical error.
   I replaced all the wordpress core files and after that im getting a http 500 
   error.. This is the error log, I checked the files but their all there.. I really
   don’t know how to fix this and hoped that someone here knows whats causing the
   problem. I didn’t make a back-up unfortunately, the site was just finished This
   is the error log I get:
 *     ```
       [28-Feb-2020 14:43:13 UTC] PHP Fatal error:  Uncaught Error: Class 'WP_Hook' not found in /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/plugin.php:111
       Stack trace:
       #0 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/wp-db.php(2110): add_filter('query', Array, 0)
       #1 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/wp-db.php(2129): wpdb->placeholder_escape()
       #2 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/wp-db.php(1180): wpdb->add_placeholder_escape('utf8mb4')
       #3 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/wp-db.php(1251): wpdb->_real_escape('utf8mb4')
       #4 [internal function]: wpdb->escape_by_ref('utf8mb4', 0)
       #5 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/wp-db.php(1396): array_walk(Array, Array)
       #6 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/wp-db.php(803): wpdb->prepare('SET NAMES '%s'', 'utf8mb4')
       #7 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/ in /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/plugin.php on line 111
       [28-Feb-2020 14:43:13 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function wp_kses_normalize_entities() in /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/formatting.php:4316
       Stack trace:
       #0 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/class-wp-fatal-error-handler.php(190): esc_url('https://wordpre...')
       #1 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false)
       #2 /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false)
       #3 [internal function]: WP_Fatal_Error_Handler->handle()
       #4 {main}
         thrown in /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/formatting.php on line 4316
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdebugging-hacked-site%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/#post-12491476)
 * It seems like you may not have replaced `wp-includes/class-wp-hook.php`
 *  Thread Starter [thomtddg](https://wordpress.org/support/users/thomtddg/)
 * (@thomtddg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/#post-12491489)
 * Thanks, the file was there but I overwritten it and now i get this error:
 *     ```
       [28-Feb-2020 15:17:30 UTC] PHP Fatal error:  Class 'WP_REST_Posts_Controller' not found in /var/www/vhosts/142/336208/webspace/httpdocs/publicproof.nl/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php on line 17
       ```
   
 *  Thread Starter [thomtddg](https://wordpress.org/support/users/thomtddg/)
 * (@thomtddg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/#post-12491507)
 * I can’t go there.. I get the ‘There has been a critical error on your website.
   Please check your site admin email inbox for instructions.
 * Learn more about debugging in WordPress.’ msg
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/#post-12491520)
 * Delete all .php files in the site’s root (except wp-config.php). Delete the directories
   wp-admin and wp-includes. Download a fresh copy of WordPress from wordpress.org.
   Unzip locally and upload all files and directories into your site’s root.
 *  Thread Starter [thomtddg](https://wordpress.org/support/users/thomtddg/)
 * (@thomtddg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/#post-12491542)
 * I already did this and still get the error
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/#post-12491555)
 * Enable wp_debug and wp_debug_log and after an error, look at wp-content/debug.
   log to see if anything gets logged there. [https://wordpress.org/support/article/debugging-in-wordpress/](https://wordpress.org/support/article/debugging-in-wordpress/)
 *  Thread Starter [thomtddg](https://wordpress.org/support/users/thomtddg/)
 * (@thomtddg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/#post-12491599)
 * Where do you think I was getting the first logs from in the first place..
    Its
   fixed there were some files that didn’t transfer completely

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

The topic ‘Debugging hacked site’ is closed to new replies.

## Tags

 * [debugging](https://wordpress.org/support/topic-tag/debugging/)
 * [hacked](https://wordpress.org/support/topic-tag/hacked/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [thomtddg](https://wordpress.org/support/users/thomtddg/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/debugging-hacked-site/#post-12491599)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
