I am getting this error when running my website :
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'sanitize_comment_cookies' not found or invalid function name in /homepages/9/d346623364/htdocs/wp-includes/class-wp-hook.php on line 286
Fatal error: Cannot redeclare comment_exists() (previously declared in /homepages/9/d346623364/htdocs/wp-includes/comment.php:27) in /homepages/9/d346623364/htdocs/wp-admin/includes/comment.php on line 43
Thanks for your help !
I am getting this error when running my website :
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'sanitize_comment_cookies' not found or invalid function name in /homepages/9/d346623364/htdocs/wp-includes/class-wp-hook.php on line 286
Fatal error: Cannot redeclare comment_exists() (previously declared in /homepages/9/d346623364/htdocs/wp-includes/comment.php:27) in /homepages/9/d346623364/htdocs/wp-admin/includes/comment.php on line 43
Thanks for your help !
Share Improve this question asked Apr 24, 2019 at 17:50 daviddavid 11 Answer
Reset to default 0Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'sanitize_comment_cookies' not found or invalid function name in /homepages/9/d346623364/htdocs/wp-includes/class-wp-hook.php on line 286
This means you have a function named sanitize_comment_cookies
hooked to an action or filter, either in your theme or a plugin, but that function is not available.
Look for the code: add_action('some_action_name', 'sanitize_comment_cookies')
or add_filter('some_filter_name', 'sanitize_comment_cookies')
and verify that the function name is correct.
Fatal error: Cannot redeclare comment_exists()
Function comment_exists
is defined in wp-admin/includes/comment.php
and it should not be in the second location. From the message you can assume that you have modified wp-includes/comment.php
file. If that is the case, download the WordPress version you are using and replace the modified file with the original one.