WordPress at a glance
function is not described

like_escape() WP 2.5.0

Deprecated from version 4.0.0. It is no longer supported and can be removed in future releases. Use wpdb::esc_like() instead.

Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described.

No Hooks.


String. text, safe for inclusion in LIKE query.


like_escape( $text );
$text(string) (required)
The text to be escaped.


  • See: wpdb::esc_like()


Since 2.5.0 Introduced.
Deprecated Since 4.0.0 Use wpdb::esc_like()

Code of like_escape() WP 5.7.1

function like_escape($text) {
	_deprecated_function( __FUNCTION__, '4.0.0', 'wpdb::esc_like()' );
	return str_replace( array( "%", "_" ), array( "\\%", "\\_" ), $text );