Title: PHP Warning: Undefined array key &#8220;comment_post_ID&#8221;
Last modified: September 28, 2022

---

# PHP Warning: Undefined array key “comment_post_ID”

 *  Resolved [Marty](https://wordpress.org/support/users/bozzmedia/)
 * (@bozzmedia)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/)
 * These debug warnings started showing up after an update to PHP 8. Anyone else
   running into this?
 *     ```
       PHP Warning:  Undefined array key "comment_post_ID" in /home/redacted/public_html/wp-content/plugins/akismet/class.akismet.php on line 187
       PHP Warning:  Undefined array key "comment_post_ID" in /home/redacted/public_html/wp-content/plugins/akismet/class.akismet.php on line 198
       PHP Warning:  Undefined array key "comment_post_ID" in /home/redacted/public_html/wp-content/plugins/akismet/class.akismet.php on line 230
   
       PHP Warning:  Undefined array key "comment_author" in /home/redacted/public_html/wp-includes/comment.php on line 2094
       PHP Warning:  Undefined array key "comment_author_url" in /home/redacted/public_html/wp-includes/comment.php on line 2112
       PHP Warning:  Undefined array key "comment_author_email" in /home/redacted/public_html/wp-includes/comment.php on line 2114
       ```
   
 * Thanks!

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

 *  Plugin Author [Christopher Finke](https://wordpress.org/support/users/cfinke/)
 * (@cfinke)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16052951)
 * Given that you’re also getting warnings from core code, I don’t think Akismet
   is the cause of this. My guess would be that another comment is storing data 
   in the comments database table but not populating comment_post_ID, comment_author,
   comment_author_url, and comment_author_email, which both Akismet and the code
   code expect.
 * You could find out by just seeing what information is in the wp_comments table(
   if you have that ability) or by listing your plugins here, and we can probably
   determine it.
 *  Thread Starter [Marty](https://wordpress.org/support/users/bozzmedia/)
 * (@bozzmedia)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16053101)
 * Thanks [@cfinke](https://wordpress.org/support/users/cfinke/)!
 * We are also using the wpdiscuz plugin.
 * When I review the database it appears there are no blank comment_post_ID entries
   in wp_comments
 *  Plugin Author [Christopher Finke](https://wordpress.org/support/users/cfinke/)
 * (@cfinke)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16056332)
 * I’ll do some testing to see if I can reproduce this, but can you tell when these
   warnings appear? Is it immediately after submitting a new comment?
 *  Thread Starter [Marty](https://wordpress.org/support/users/bozzmedia/)
 * (@bozzmedia)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16059534)
 * I’m not certain, these are just entries in our debug.log. If I can find a specific
   source I will update here. Thanks for looking into it!
 *  Thread Starter [Marty](https://wordpress.org/support/users/bozzmedia/)
 * (@bozzmedia)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16066538)
 * It seems the URL that is reported with the error is:
 * `/wp-admin/admin-ajax.php`
 * Newer trace:
 * Undefined array key “comment_author_email”
 *     ```
       in wp_filter_comment called at /home/public_html/production/wp-content/plugins/akismet/class.akismet.php (333)
        in Akismet::set_last_comment called at /home/public_html/production/wp-content/plugins/akismet/class.akismet.php (313)
        in Akismet::auto_check_comment called at /home/public_html/production/wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php (547)
        in WpdiscuzCore::saveEditedComment called at /home/public_html/production/wp-includes/class-wp-hook.php (307)
        in WP_Hook::apply_filters called at /home/public_html/production/wp-includes/class-wp-hook.php (331)
        in WP_Hook::do_action called at /home/public_html/production/wp-includes/plugin.php (476)
        in do_action called at /home/public_html/production/wp-admin/admin-ajax.php (187)
       ```
   
 *  Thread Starter [Marty](https://wordpress.org/support/users/bozzmedia/)
 * (@bozzmedia)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16066547)
 * I have also inquired here in case the wpDiscuz dev (@gvectors-team) has any thoughts
   about how the `WpdiscuzCore::saveEditedComment` function is involved:
 * [https://wordpress.org/support/topic/potential-issue-with-akismet-undefined-array-key-php-8/](https://wordpress.org/support/topic/potential-issue-with-akismet-undefined-array-key-php-8/)
    -  This reply was modified 3 years, 8 months ago by [Marty](https://wordpress.org/support/users/bozzmedia/).
 *  Plugin Author [Christopher Finke](https://wordpress.org/support/users/cfinke/)
 * (@cfinke)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16069370)
 * It looks like wpDiscuz will be addressing this; I’ll watch for their fix and 
   check whether we can improve Akismet to handle similar situations more gracefully.
 *  Thread Starter [Marty](https://wordpress.org/support/users/bozzmedia/)
 * (@bozzmedia)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16069530)
 * Thanks [@cfinke](https://wordpress.org/support/users/cfinke/), I appreciate your
   attention and help with this issue.

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

The topic ‘PHP Warning: Undefined array key “comment_post_ID”’ is closed to new 
replies.

 * ![](https://ps.w.org/akismet/assets/icon-256x256.png?rev=2818463)
 * [Akismet Anti-spam: Spam Protection](https://wordpress.org/plugins/akismet/)
 * [Support Threads](https://wordpress.org/support/plugin/akismet/)
 * [Active Topics](https://wordpress.org/support/plugin/akismet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/akismet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/akismet/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Marty](https://wordpress.org/support/users/bozzmedia/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-comment_post_id/#post-16069530)
 * Status: resolved