WordPress at a glance
function is not described

sanitize_url() WP 2.3.1

Deprecated in 2.8.0. It is no longer supported and can be removed in future releases. Use esc_url_raw() instead.

Performs esc_url() for database or redirect usage.

  • See: esc_url_raw()

No Hooks.


String. The cleaned URL.


sanitize_url( $url, $protocols );
$url(string) (required)
The URL to be cleaned.
An array of acceptable protocols.
Default: null

Code of sanitize url: wp-includes/deprecated.php WP 5.2.2

function sanitize_url( $url, $protocols = null ) {
	_deprecated_function( __FUNCTION__, '2.8.0', 'esc_url_raw()' );
	return esc_url_raw( $url, $protocols );