WordPress at Your Fingertips
function is not described

wc_prevent_endpoint_indexing() WC 2.5.3

No index our endpoints. Prevent indexing pages like order-received.

No Hooks.

Return

null. Nothing.

Usage

wc_prevent_endpoint_indexing();

Changelog

Since 2.5.3 Introduced.

Code of wc_prevent_endpoint_indexing() WC 5.8.0

function wc_prevent_endpoint_indexing() {
	// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.PHP.NoSilencedErrors.Discouraged
	if ( is_wc_endpoint_url() || isset( $_GET['download_file'] ) ) {
		@header( 'X-Robots-Tag: noindex' );
	}
	// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.PHP.NoSilencedErrors.Discouraged
}