WordPress at Your Fingertips
function is not described

wc_page_noindex() WC 3.2.0

Disable search engines indexing core, dynamic, cart/checkout pages.

No Hooks.

Return

null. Nothing.

Usage

wc_page_noindex();

Changelog

Since 3.2.0 Introduced.

Code of wc_page_noindex() WC 5.8.0

function wc_page_noindex() {
	// wp_no_robots is deprecated since WP 5.7.
	if ( function_exists( 'wp_robots_no_robots' ) ) {
		return;
	}

	if ( is_page( wc_get_page_id( 'cart' ) ) || is_page( wc_get_page_id( 'checkout' ) ) || is_page( wc_get_page_id( 'myaccount' ) ) ) {
		wp_no_robots();
	}
}