wp_no_robots

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

WordPress Version: 6.1

/**
 * Display a `noindex` meta tag.
 *
 * Outputs a `noindex` meta tag that tells web robots not to index the page content.
 *
 * Typical usage is as a {@see 'wp_head'} callback:
 *
 *     add_action( 'wp_head', 'wp_no_robots' );
 *
 * @since 3.3.0
 * @since 5.3.0 Echo `noindex,nofollow` if search engine visibility is discouraged.
 * @deprecated 5.7.0 Use wp_robots_no_robots() instead on 'wp_robots' filter.
 */
function wp_no_robots()
{
    _deprecated_function(__FUNCTION__, '5.7.0', 'wp_robots_no_robots()');
    if (get_option('blog_public')) {
        echo "<meta name='robots' content='noindex,follow' />\n";
        return;
    }
    echo "<meta name='robots' content='noindex,nofollow' />\n";
}

WordPress Version: 5.7

/**
 * Display a noindex meta tag.
 *
 * Outputs a noindex meta tag that tells web robots not to index the page content.
 * Typical usage is as a {@see 'wp_head'} callback. add_action( 'wp_head', 'wp_no_robots' );
 *
 * @since 3.3.0
 * @since 5.3.0 Echo "noindex,nofollow" if search engine visibility is discouraged.
 * @deprecated 5.7.0 Use wp_robots_no_robots() instead on 'wp_robots' filter.
 */
function wp_no_robots()
{
    _deprecated_function(__FUNCTION__, '5.7.0', 'wp_robots_no_robots()');
    if (get_option('blog_public')) {
        echo "<meta name='robots' content='noindex,follow' />\n";
        return;
    }
    echo "<meta name='robots' content='noindex,nofollow' />\n";
}

WordPress Version: 5.3

/**
 * Display a noindex meta tag.
 *
 * Outputs a noindex meta tag that tells web robots not to index the page content.
 * Typical usage is as a {@see 'wp_head'} callback. add_action( 'wp_head', 'wp_no_robots' );
 *
 * @since 3.3.0
 * @since 5.3.0 Echo "noindex,nofollow" if search engine visibility is discouraged.
 */
function wp_no_robots()
{
    if (get_option('blog_public')) {
        echo "<meta name='robots' content='noindex,follow' />\n";
        return;
    }
    echo "<meta name='robots' content='noindex,nofollow' />\n";
}

WordPress Version: 3.8

/**
 * Display a noindex meta tag.
 *
 * Outputs a noindex meta tag that tells web robots not to index the page content.
 * Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_no_robots' );
 *
 * @since 3.3.0
 */
function wp_no_robots()
{
    echo "<meta name='robots' content='noindex,follow' />\n";
}

WordPress Version: 3.7

/**
 * Display a noindex meta tag.
 *
 * Outputs a noindex meta tag that tells web robots not to index the page content.
 * Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_no_robots' );
 *
 * @since 3.3.0
 */
function wp_no_robots()
{
    echo "<meta name='robots' content='noindex,nofollow' />\n";
}