esc_url_raw( string $url, string[] $protocols = null )

Sanitizes a URL for database or redirect usage.


Description

This function is an alias for sanitize_url().

See also


Parameters

$url

(Required) The URL to be cleaned.

$protocols

(Optional) An array of acceptable protocols.<br> Defaults to return value of wp_allowed_protocols().

Default value: null


Return

(string) The cleaned URL after sanitize_url() is run.


Source

File: wp-includes/formatting.php

function esc_url_raw( $url, $protocols = null ) {
	return esc_url( $url, $protocols, 'db' );
}

Changelog

Changelog
Version Description
6.1.0 Turned into an alias for sanitize_url().
2.8.0 Introduced.