Title: WordPress database error Column &#039;id&#039; cannot be null
Last modified: August 31, 2016

---

# WordPress database error Column 'id' cannot be null

 *  Resolved [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * (@josiah-s-carberry)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-id-cannot-be-null/)
 * Using WP Statistics 10.0.5
 * I have been getting errors similar to:
 * [Mon Mar 14 07:49:38 2016] [error] [client <an IP address>] FastCGI: server “/
   home/clients/blahblah/.config/apache/mysite.com/.fpm/php5.external” stderr: PHP
   message: WordPress database error Column ‘id’ cannot be null for query INSERT
   INTO `wp_statistics_pages` (`uri`, `date`, `count`, `id`) VALUES (‘/index.php?
   social_controller=auth&social_action=reload_form&redirect_to=https://mysite.com/
   some-page/&post_id=xxxx’, ‘2016-03-14’, 1, NULL) made by shutdown_action_hook,
   do_action(‘shutdown’), call_user_func_array, wp_statistics_shutdown_action, Hits-
   >Pages, referer: [https://mysite.com/some-page/](https://mysite.com/some-page/)
 * They are not associated (in time) with other errors.
 * Sometimes they appear alone, sometimes in a series of the same error during a
   single session.
 * Most of the errors concern page hits, but some also concern other types of hits.
 * So, is this a bug? The trace of an attack? Something else?
 * Thanks!
 * [https://wordpress.org/plugins/wp-statistics/](https://wordpress.org/plugins/wp-statistics/)

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

 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-id-cannot-be-null/#post-7169761)
 * This is because the page has no associated ID with it in WordPress. I’ll add 
   a check in the pages code to handle this condition in the next release.
 *  [Anticosti](https://wordpress.org/support/users/anticosti/)
 * (@anticosti)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-id-cannot-be-null/#post-7169797)
 * Same issue here Greg 😉
    Thanks for the info 🙂
 *  Thread Starter [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * (@josiah-s-carberry)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-id-cannot-be-null/#post-7169860)
 * I checked the database and there are no rows in the table with the page definitions
   where the ID is null. The particular posts mentioned in the error messages all
   exist and the page id is correct for the post. It’s fine to handle null values,
   but whyever should there be a null value in the first place’
 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-id-cannot-be-null/#post-7169867)
 * There will be a null value if a url is accessed (and handled by WordPress) that
   isn’t a page/post. For example, in the above it looks like a plugin is serving
   up `/index.php?social_controller=auth&social_action=reload_form`, which is fine,
   but it will not have a related page/post id for us to track.

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

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

 * ![](https://ps.w.org/wp-statistics/assets/icon.svg?rev=3081064)
 * [WP Statistics – Simple, privacy-friendly Google Analytics alternative](https://wordpress.org/plugins/wp-statistics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-statistics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-statistics/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-statistics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-statistics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-statistics/reviews/)

## Tags

 * [id](https://wordpress.org/support/topic-tag/id/)
 * [NULL](https://wordpress.org/support/topic-tag/null/)

 * 4 replies
 * 3 participants
 * Last reply from: [Greg Ross](https://wordpress.org/support/users/gregross/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-column-id-cannot-be-null/#post-7169867)
 * Status: resolved