You are here

function hook_robotstxt in RobotsTxt 8

Same name and namespace in other branches
  1. 6 robotstxt.api.php \hook_robotstxt()
  2. 7 robotstxt.api.php \hook_robotstxt()

Add additional lines to the site's robots.txt file.

Return value

array An array of strings to add to the robots.txt.

1 invocation of hook_robotstxt()
RobotsTxtController::content in src/Controller/RobotsTxtController.php
Serves the configured robots.txt file.

File

./robotstxt.api.php, line 14
Hooks provided by the robotstxt module.

Code

function hook_robotstxt() {
  return [
    'Disallow: /foo',
    'Disallow: /bar',
  ];
}