W3cubDocs

/WordPress

wp_filter_nohtml_kses( string $data ): string

Strips all HTML from a text string.

Description

This function expects slashed data.

Parameters

$datastringrequired
Content to strip all HTML from.

Return

string Filtered content without any HTML.

Source

function wp_filter_nohtml_kses( $data ) {
	return addslashes( wp_kses( stripslashes( $data ), 'strip' ) );
}

Changelog

Version Description
2.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_filter_nohtml_kses