Frontend Robots
Accidentally indexed staging environments are a common and expensive problem: duplicate content competing with the live site, internal drafts surfacing in search results, and clean-up work that takes weeks. This indicator signals the environment to crawlers so non-production content does not end up in search engines in the first place.
It adds an X- header to every frontend response:
X-Robots-Tag: noindex, nofollow
You can register the indicator in your ext_:
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Testing/Staging')
],
indicators: [
new Indicator\Frontend\Robots()
]
);
Additional optional configuration keys:
content(string): The header value. Default isnoindex, nofollow. A value that is not valid per9110is ignored and logged as a warning.
Warning
This indicator changes how search engines treat the site. Never trigger it
in a production context — a noindex on the live site removes it
from search results. Restrict it to non-production contexts via its
triggers and double-check the trigger configuration before deploying.
Note
Unlike the other indicators, this one is not part of the default configuration presets and never will be. Silently changing the SEO behaviour of an existing installation on update would be unacceptable, so the indicator only ever does something if you register it yourself.
Note
The X- header is used instead of a
<meta name="robots"> tag on purpose: unlike the meta tag it also
covers non-HTML resources such as PDFs, images and feeds, which are
otherwise indexed even on a staging system.
Note
An X- that is already present on the response keeps
precedence — the indicator never overwrites it. The same header handling
rules as for Frontend HTTP Header apply.
The X- header can be disabled globally via the
extension configuration.