Title: WordPress database error Column &#8216;statusCode&#8217; cannot be null
Last modified: September 17, 2019

---

# WordPress database error Column ‘statusCode’ cannot be null

 *  [a305587](https://wordpress.org/support/users/a305587/)
 * (@a305587)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/)
 * Hello,
 * I’m getting this error that many others have gotten. I see hundreds of these 
   errors in my logs for all sorts of warnings in every table… I think my version
   of Wordfence is corrupted?
 * example:
 * [17-Sep-2019 16:41:28 UTC] WordPress database error Column ‘statusCode’ cannot
   be null for query INSERT INTO `wp_wfHits` (`ctime`, `statusCode`, `isGoogle`,`
   IP`, `userID`, `URL`, `referer`, `UA`, `jsRun`, `id`) VALUES (‘1568738488.094598’,
   NULL, ‘0’, ‘\0\0\0\0\0\0\0\0\0\0ÿÿ:a•’, ‘0’, ‘[https://xxxxxxxxxxxxx.com/spring-cleaning/&#8217](https://xxxxxxxxxxxxx.com/spring-cleaning/&#8217);,”,‘
   Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like
   Gecko) Version/8.0.2 Safari/600.2.5 (Applebot/0.1; +http://www.apple.com/go/applebot)’,”,‘
   0’) made by wfLog->logHit, wfRequestModel->save, wfModel->save, wfModel->insert
 * Here’s the problem though. I’ve tried re-installing Wordfence by following the
   removal instructions on this page ([https://www.wordfence.com/help/advanced/remove-or-reset/](https://www.wordfence.com/help/advanced/remove-or-reset/))
   as instructed by WF support in other threads with this same issue. I’m not certain
   the removal completely worked; when I re-installed, all my previous settings 
   were remembered. And my problems persist in the error log.
 * Any help is appreciated.
    -  This topic was modified 6 years, 8 months ago by [a305587](https://wordpress.org/support/users/a305587/).
    -  This topic was modified 6 years, 8 months ago by [a305587](https://wordpress.org/support/users/a305587/).

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

 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-11941934)
 * Hey [@a305587](https://wordpress.org/support/users/a305587/),
 * I believe resetting Wordfence should do the trick. Can you please try once more
   using the Wordfence Assistant plugin?
 * [https://www.wordfence.com/help/advanced/remove-or-reset/#remove-or-reset](https://www.wordfence.com/help/advanced/remove-or-reset/#remove-or-reset)
 * Please let me know how it goes.
 * Thanks,
 * Gerroald
 *  Thread Starter [a305587](https://wordpress.org/support/users/a305587/)
 * (@a305587)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-11946138)
 * Hello Gerroald,
 * Thanks for your response. The Wordfence Assistant plugin did help with full removal
   of Wordfence, thank you. However this process of removing and reinstalling Wordfence
   did not fix our problem.
 * Upon further review of the error we’re receiving, I’m not sure it would fix the
   problem. I think there’s an error in the Wordfence code. Stay with me… We have
   > 15 websites across multiple servers in which we use your excellent plugin. 
   After we spent more time analyzing our error logs we noticed all of our sites
   are seeing this error.
 * Here’s the error we’re seeing:
 * [18-Sep-2019 16:51:47 UTC] WordPress database error Column ‘statusCode’ cannot
   be null for query INSERT INTO `wp_wfHits` (`ctime`, `statusCode`, `isGoogle`,`
   IP`, `userID`, `URL`, `referer`, `UA`, `jsRun`, `id`) VALUES (‘1568825507.287943’,
   NULL, ‘0’, ‘\0\0\0\0\0\0\0\0\0\0ÿÿê*’, ‘0’, ‘[https://www.xxxxxxxx.com/&#8217](https://www.xxxxxxxx.com/&#8217);,”,‘
   curl/7.54.0’, ”, ‘0’) made by wfLog->logHit, wfRequestModel->save, wfModel->save,
   wfModel->insert
 * Here’s a screenshot of a look inside phpMyAdmin where this is reflected:
    [https://ibb.co/8jQgFk3](https://ibb.co/8jQgFk3)
 * Looking at the error, it’s saying an entry into the database cannot be null. 
   Correct me if I’m wrong, but this sounds like a structural problem within the
   database setup by Wordfence, not my website.
 * Last night I ran a test on one of our sites – I went into the database and changed
   the settings for the column of ‘statusCode’ to where it CAN be null. Then I reset
   my error log and have let it run. I was previously getting this error every 2-
   3 minutes, since I made the change I have had zero errors in the error log. So
   my fix of allowing ‘statusCode’ column to allow for Null has appeared to fix 
   the problem.
    Problem fixed screenshot: [https://ibb.co/j3pWwHd](https://ibb.co/j3pWwHd)
 * My concern is what tangential effects does this have downstream?
 * And I don’t want to pretend that you guys didn’t/don’t know about this issue 
   either. If it’s happening to my 15 websites, surely it’s happened to the others
   of the 3 million+ sites it’s installed on elsewhere.
 * I’m curious as to why this happened, if I should continue with my fix on my other
   sites, the repercussions of this fix, if you recommend I continue with the fix
   or if you advise against it, etc.
 * Thank you for your time!
 *  Thread Starter [a305587](https://wordpress.org/support/users/a305587/)
 * (@a305587)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-11961056)
 * Update: I’m still seeing these errors on over a dozen of our sites, the only 
   exception being the site I “cleaned” by updating the table structure to allow
   for NULL no longer reports the errors.
 * Here’s an example:
 * [23-Sep-2019 18:25:53 UTC] WordPress database error Column ‘statusCode’ cannot
   be null for query INSERT INTO `wp_wfhits` (`ctime`, `statusCode`, `isGoogle`,`
   IP`, `userID`, `URL`, `referer`, `UA`, `jsRun`, `id`) VALUES (‘1569263153.148954’,
   NULL, ‘0’, ‘\0\0\0\0\0\0\0\0\0\0ÿÿÏúêd’, ‘0’, ‘[https://xxxxxxxxxx.com/&#8217](https://xxxxxxxxxx.com/&#8217);,”,‘
   Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; .NET CLR 1.1.4322;.
   NET CLR 1.0.3705; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022;.
   NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) DMBrowser/2.1 (SV)’, ”, ‘0’) made 
   by wfLog->logHit, wfRequestModel->save, wfModel->save, wfModel->insert
 * Does WordFence have an idea of what is causing these errors? My logs are ballooning
   to ridiculous sizes.
 * Thank you.
    -  This reply was modified 6 years, 8 months ago by [a305587](https://wordpress.org/support/users/a305587/).
 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-11968400)
 * Hey [@a305587](https://wordpress.org/support/users/a305587/),
 * Have you obfuscated the IP in the error you’ve shared, or is it actually `\0\
   0\0\0\0\0\0\0\0\0ÿÿÏúêd`? If this is how it’s appearing in the error log can 
   you please try adjusting your How Wordfence Gets Visitors IPs to see if it helps?
 * If this doesn’t help can you please send me a Diagnostics report so I can get
   a better overview of your environment? Please navigate to **Wordfence > Tools
   > Diagnostics**. Here you can select `SEND REPORT BY EMAIL`. Please include your
   WordPress.org username and update this thread after you’ve sent it.
 * Thanks,
 * Gerroald
 *  Thread Starter [a305587](https://wordpress.org/support/users/a305587/)
 * (@a305587)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-11969205)
 * Thank you Gerroald, I appreciate your time. I have submitted the report via email.
 * I did not obfuscate the IP address, it actually comes through as that on the 
   error log. And it appears to do this for most entries. I _did_ obfuscate the 
   URL of my site for public display here (although this will be visible to you 
   in the emailed report).
 * I did try changing how WordFence gets IPs to the 2nd option (Use PHP’s built-
   in REMOTE_ADDR), but this did not appear to fix the issue. When I checked the
   error log afterward I was still seeing the errors.
 * A note on the error logs when you view the emailed report: When I make a change
   to the settings, I reset the error logs by appending the date to the end of the
   file. So for example when I tried changing a setting in WordFence on 9/23/19 
   to test if it fixed the issue, I wanted to reset the error log, so I renamed 
   the old error log “error_log-092319”. I’m explaining this so when you get said
   report you’ll understand the meaning of all the error logs and the numbers after
   them. 😉 The error log without a number after it is the current one. Most recent
   change attempt was me changing how WF gets its IP addresses.
 * Thanks again for taking the time to look into this, I appreciate your help sir.
 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-12018307)
 * Hey [@a305587](https://wordpress.org/support/users/a305587/),
 * My apologies for the delay with this.
 * After doing a lot of digging and internal conversations about this we’ve come
   to the conclusion that this is likely a plugin conflict. Are you able to share
   a list of your plugin so we can dig a little deeper?
 * Please let me know.
 * Thanks,
 * Gerroald
 *  Thread Starter [a305587](https://wordpress.org/support/users/a305587/)
 * (@a305587)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-12018587)
 * Hello Gerroald,
 * Thank you for your continuing attention to this matter.
 * This particular issue is affecting every site under our purview (~15 sites across
   multiple servers) and we have a variety of plugins installed on each site. There
   are overlaps in the plugins used on each site, however there are many differences
   depending on the website’s mission.
 * I’ll pick one site for your query (same one used above from the error log):
 * * Advanced Custom Fields PRO
    * Classic Editor * Companion Auto Update * Custom
   Post Type UI * Ivory Search * Jetpack * LearnPress * Post Snippets * Really Simple
   SSL * Shortcoder * Simple CSS * Slimstat Analytics * UpdraftPlus Backup/Restore*
   Wordfence Security * WP Crontrol * WPForms * WPForms Custom Captcha * Yoast SEO
 * These are the only plugins we have installed on _every_ site (common denominators):
 * * Classic Editor
    * Companion Auto Update * Really Simple SSL * UpdraftPlus Backup/
   Restore * WordFence Security
 * Thank you again.
 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-12021096)
 * Hey [@a305587](https://wordpress.org/support/users/a305587/),
 * Thanks for sharing this. I’ve shared the lists with the developers.
 * Are these sites on the same server or hosting?
 * Thanks,
 * Gerroald
 *  Thread Starter [a305587](https://wordpress.org/support/users/a305587/)
 * (@a305587)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-12022311)
 * Hello Gerroald,
 * Thank you again for continuing attention. All sites are on a single Bluehost 
   VPS, however they are split between two cPanels. We have control up to WHM level.
 * Regards
    -  This reply was modified 6 years, 7 months ago by [a305587](https://wordpress.org/support/users/a305587/).

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

The topic ‘WordPress database error Column ‘statusCode’ cannot be null’ is closed
to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 9 replies
 * 0 participants
 * Last reply from: [a305587](https://wordpress.org/support/users/a305587/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-statuscode-cannot-be-null/#post-12022311)
 * Status: not resolved