Skip Navigation
Docs

Robots.txt bot directives

By default, Kirby SEO will dynamically generate a robots.txt file and add the robots meta tag to any page.

If a page is set to noindex, canonical tags and similar will not be added to the page as well.

You can disable all Robots handling, by setting tobimori.seo.robots.active to false in your config.php.

Panel

Next to the page status button, there is an "Indexing Allowed/Disallowed" button that shows the current robots status of the page.

You can hide this by setting tobimori.seo.robots.indicator to false in your config.php.

By default, there is a robots section in the panel. This allows overriding the site-wide robots rules from config.php on a per-page basis. The robots fields follow the same cascade logic as other metadata fields.

You can remove this section by setting tobimori.seo.robots.pageSettings to false in your config.php.

Site-wide Defaults (Options cascade)

By default, the page status determines if indexing is allowed. Drafts and unlisted pages are disallowed from indexing. Indexing is also disallowed if debug mode is enabled. These defaults can be overridden in the panel.

You can disable following the page status by setting tobimori.seo.robots.followPageStatus to false in your config.php.

The default indexing behavior for published pages can be customized by setting tobimori.seo.robots.index to a boolean or callable that returns a boolean.

Options

tobimori.seo.robots. Default Accepts Description
active true boolean Enable/disable the entire robots module
followPageStatus true boolean Disable default behavior of blocking drafts/unlisted pages
pageSettings true boolean Show/hide Robots fields in the panel blueprint tab
indicator true boolean Show/hide indexing indicator next to page status
index fn () => !option('debug') boolean|callback Default indexing setting for published pages
sitemap null string|callback Sitemap URL to include in robots.txt, filled automatically if sitemap module is enabled
content [] array Custom robots.txt rules
types internal array Valid robot directive types - do not modify

Options allow you to fine tune the behaviour of the plugin. You can set them in your config.php file:

// site/config/config.php

return [
    'tobimori.seo.robots' => [
        'active' => true,
        'content' => [
            '*' => [
                'Allow' => ['/'],
                'Disallow' => ['/kirby', '/panel', '/content']
            ]
        ]
    ],
];

Support Kirby SEO development:
Get a Stay Awesome License

Kirby SEO is available completely free of charge.
If you’re using it to deliver a commercial project, please consider supporting further development & maintenance financially.

Sponsor