wp_get_raw_referer()

Retrieves unvalidated referer from ‘_wp_http_referer’ or HTTP referer.


Description Description

Do not use for redirects, use wp_get_referer() instead.


Return Return

(string|false) Referer URL on success, false on failure.


Top ↑

Source Source

File: wp-includes/functions.php

function wp_get_raw_referer() {
	if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
		return wp_unslash( $_REQUEST['_wp_http_referer'] );
	} elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
		return wp_unslash( $_SERVER['HTTP_REFERER'] );
	}

	return false;
}

Top ↑

Changelog Changelog

Changelog
Version Description
4.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.