wp_robots WordPress Filter Hook

The wp_robots hook is used to add content to the robots.txt file that is generated when a WordPress site is displayed in a web browser. This hook can be used to add directives for specific user agents, such as Googlebot, to the robots.txt file.

apply_filters( 'wp_robots', array $robots ) #

Filters the directives to be included in the ‘robots’ meta tag.


Description

The meta tag will only be included as necessary.


Top ↑

Parameters

$robots

(array)Associative array of directives. Every key must be the name of the directive, and the corresponding value must either be a string to provide as value for the directive or a boolean true if it is a boolean directive, i.e. without a value.


Top ↑

Source

File: wp-includes/robots-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.