WordPress at a glance

wp_kses_post() WP 1.0

Sanitize content for allowed HTML tags for post content.

Post content refers to the page contents of the 'post' type and not $_POST data from forms.

This function expects unslashed data.

Works based on: wp_kses()
1 time = 0.000492s = fast | 50000 times = 10.07s = slow | PHP 7.1.5, WP 4.8

No Hooks.


String. Filtered post content with allowed HTML tags and attributes intact.


wp_kses_post( $data );
$data(string) (required)
Post content to filter.


Since 2.9.0 Introduced.

Code of wp_kses_post() WP 5.6

function wp_kses_post( $data ) {
	return wp_kses( $data, 'post' );

From tag: kses (html cleanup sanitize)

More from category: Security

No comments
    Log In