wc_prevent_endpoint_indexing

No index our endpoints.

Description

wc_prevent_endpoint_indexing(); 

Prevent indexing pages like order-received.


Usage

  1. if ( !function_exists( 'wc_prevent_endpoint_indexing' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_prevent_endpoint_indexing(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-template-functions.php  
  1. function wc_prevent_endpoint_indexing() { 
  2. if ( is_wc_endpoint_url() || isset( $_GET['download_file'] ) ) { 
  3. @header( 'X-Robots-Tag: noindex' );