Title: wp_get_comment_fields_max_lengths
Published: April 12, 2016
Last modified: May 20, 2026

---

# apply_filters( ‘wp_get_comment_fields_max_lengths’, int[] $lengths )

## In this article

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

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

Filters the lengths for the comment form fields.

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

 `$lengths`int[]

Array of maximum lengths keyed by field name.

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

    ```php
    return apply_filters( 'wp_get_comment_fields_max_lengths', $lengths );
    ```

[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#L1249)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/comment.php#L1249-L1249)

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

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

Retrieves the maximum character lengths for the comment form fields.

  |

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

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

## User Contributed Notes

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