noindex

The timeline below displays how wordpress function noindex has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Displays a `noindex` meta tag if required by the blog configuration.
 *
 * If a blog is marked as not being public then the `noindex` meta tag will be
 * output to tell web robots not to index the page content.
 *
 * Typical usage is as a {@see 'wp_head'} callback:
 *
 *     add_action( 'wp_head', 'noindex' );
 *
 * @see wp_no_robots()
 *
 * @since 2.1.0
 * @deprecated 5.7.0 Use wp_robots_noindex() instead on 'wp_robots' filter.
 */
function noindex()
{
    _deprecated_function(__FUNCTION__, '5.7.0', 'wp_robots_noindex()');
    // If the blog is not public, tell robots to go away.
    if ('0' == get_option('blog_public')) {
        wp_no_robots();
    }
}

WordPress Version: 5.7

/**
 * Displays a noindex meta tag if required by the blog configuration.
 *
 * If a blog is marked as not being public then the noindex meta tag will be
 * output to tell web robots not to index the page content. Add this to the
 * {@see 'wp_head'} action.
 *
 * Typical usage is as a {@see 'wp_head'} callback:
 *
 *     add_action( 'wp_head', 'noindex' );
 *
 * @see wp_no_robots()
 *
 * @since 2.1.0
 * @deprecated 5.7.0 Use wp_robots_noindex() instead on 'wp_robots' filter.
 */
function noindex()
{
    _deprecated_function(__FUNCTION__, '5.7.0', 'wp_robots_noindex()');
    // If the blog is not public, tell robots to go away.
    if ('0' == get_option('blog_public')) {
        wp_no_robots();
    }
}

WordPress Version: 5.6

/**
 * Displays a noindex meta tag if required by the blog configuration.
 *
 * If a blog is marked as not being public then the noindex meta tag will be
 * output to tell web robots not to index the page content. Add this to the
 * {@see 'wp_head'} action.
 *
 * Typical usage is as a {@see 'wp_head'} callback:
 *
 *     add_action( 'wp_head', 'noindex' );
 *
 * @see wp_no_robots()
 *
 * @since 2.1.0
 */
function noindex()
{
    // If the blog is not public, tell robots to go away.
    if ('0' == get_option('blog_public')) {
        wp_no_robots();
    }
}

WordPress Version: 4.6

/**
 * Displays a noindex meta tag if required by the blog configuration.
 *
 * If a blog is marked as not being public then the noindex meta tag will be
 * output to tell web robots not to index the page content. Add this to the
 * {@see 'wp_head'} action.
 *
 * Typical usage is as a {@see 'wp_head'} callback:
 *
 *     add_action( 'wp_head', 'noindex' );
 *
 * @see wp_no_robots
 *
 * @since 2.1.0
 */
function noindex()
{
    // If the blog is not public, tell robots to go away.
    if ('0' == get_option('blog_public')) {
        wp_no_robots();
    }
}

WordPress Version: 3.7

/**
 * Display a noindex meta tag if required by the blog configuration.
 *
 * If a blog is marked as not being public then the noindex meta tag will be
 * output to tell web robots not to index the page content. Add this to the wp_head action.
 * Typical usage is as a wp_head callback. add_action( 'wp_head', 'noindex' );
 *
 * @see wp_no_robots
 *
 * @since 2.1.0
 */
function noindex()
{
    // If the blog is not public, tell robots to go away.
    if ('0' == get_option('blog_public')) {
        wp_no_robots();
    }
}