Fatal error: Uncaught Error: Call to undefined function wp_kses()

Error:

Fatal error: Uncaught Error: Call to undefined function wp_kses() in /home/e03qaszuq0bd/public_html/wp-includes/functions.php:6066 
Stack trace: 
#0 /home/e03qaszuq0bd/public_html/wp-includes/functions.php(5547): wp_trigger_error('', 'Function wpdb::...', 16384) 
#1 /home/e03qaszuq0bd/public_html/wp-includes/class-wpdb.php(1338): _deprecated_function('wpdb::escape', '3.6.0', 'wpdb::prepare()...') 
#2 /home/e03qaszuq0bd/public_html/wp-content/sunrise.php(11): wpdb->escape('www.ericstoltz....') 
#3 /home/e03qaszuq0bd/public_html/wp-includes/ms-settings.php(47): include_once('/home/e03qaszuq...') 
#4 /home/e03qaszuq0bd/public_html/wp-settings.php(154): require('/home/e03qaszuq...') 
#5 /home/e03qaszuq0bd/public_html/wp-config.php(107): require_once('/home/e03qaszuq...') 
#6 /home/e03qaszuq0bd/public_html/wp-load.php(50): require_once('/home/e03qaszuq...') 
#7 /home/e03qaszuq0bd/public_html/wp-blog-header.php(13): require_once('/home/e03qaszuq...') 
#8 /home/e03qaszuq0bd/public_html/index.php(17): require('/home/e03qaszuq...') 
#9 {main in /home/e03qaszuq0bd/public_html/wp-includes/functions.php on line 6066

Steps to Fix the Error:

  1. Identify the Issue: The error indicates that the wp_kses() function is missing, which suggests that the core WordPress files may be corrupted or incomplete.
  2. Access Your Site: Temporarily disable the code causing the error to log into the WordPress admin area. This can be done by renaming the file or folder that contains the problematic code.
  3. In this case, temporarily comment out the code as shown in the image below, then you can access wp-admin to re-install WordPress.
  4. Reinstall WordPress Core Files via WordPress Admin:
    • Once logged into the WordPress admin area, navigate to Dashboard > Updates.
    • Click on the “Re-install Now” button to reinstall the WordPress core files automatically.
  5. Check for Success: After the reinstallation is complete, visit your website to ensure that the error has been resolved. Verify that all functionalities are working correctly.

Additional Tips:

  • Backup Your Site: Always take a full backup of your site (both files and database) before making any significant changes.
  • Check for Plugin Conflicts: If the issue persists, deactivate all plugins and reactivate them one by one to identify if a plugin is causing the conflict.
  • Contact Hosting Support: If you’re unable to resolve the issue on your own, consider contacting your web hosting provider’s support team for assistance.

By following these steps, you should be able to resolve the wp_kses() function error and restore your WordPress site to normal operation.

Leave a Comment

Your email address will not be published. Required fields are marked *