Title: pre_comment_author_email
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘pre_comment_author_email’, string $author_email_cookie )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#wp--skip-link--target)

Filters the comment author’s email cookie before it is set.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#description)󠁿

When this filter hook is evaluated in [wp_filter_comment()](https://developer.wordpress.org/reference/functions/wp_filter_comment/),
the comment author’s email string is passed.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#parameters)󠁿

 `$author_email_cookie`string

The comment author email cookie.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#source)󠁿

    ```php
    $comment_author_email = apply_filters( 'pre_comment_author_email', $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/comment.php#L652)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/comment.php#L652-L652)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_filter_comment()](https://developer.wordpress.org/reference/functions/wp_filter_comment/)`wp-includes/comment.php` |

Filters and sanitizes comment data.

  | 
| [sanitize_comment_cookies()](https://developer.wordpress.org/reference/functions/sanitize_comment_cookies/)`wp-includes/comment.php` |

Sanitizes the cookies sent to the user already.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/pre_comment_author_email/?output_format=md#changelog)󠁿

| Version | Description | 
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpre_comment_author_email%2F)
before being able to contribute a note or feedback.