Summery Summery

Compares the lengths of comment data against the maximum character limits.

Syntax Syntax

wp_check_comment_data_max_lengths( array $comment_data )

Parameters Parameters


(array) (Required) Array of arguments for inserting a comment.

Return Return

(WP_Error|true) WP_Error when a comment field exceeds the limit, otherwise true.

Source Source

File: wp-includes/comment.php

	return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_ID );

 * Retrieves the maximum character lengths for the comment form fields.
 * @since 4.5.0
 * @global wpdb $wpdb WordPress database abstraction object.
 * @return int[] Array of maximum lengths keyed by field name.
function wp_get_comment_fields_max_lengths() {
	global $wpdb;

	$lengths = array(
		'comment_author'       => 245,
		'comment_author_email' => 100,
		'comment_author_url'   => 200,
		'comment_content'      => 65525,


Changelog Changelog

Version Description
4.7.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.