Crumpled.RobotsTxt
3.0.3
dotnet add package Crumpled.RobotsTxt --version 3.0.3
NuGet\Install-Package Crumpled.RobotsTxt -Version 3.0.3
<PackageReference Include="Crumpled.RobotsTxt" Version="3.0.3" />
<PackageVersion Include="Crumpled.RobotsTxt" Version="3.0.3" />
<PackageReference Include="Crumpled.RobotsTxt" />
paket add Crumpled.RobotsTxt --version 3.0.3
#r "nuget: Crumpled.RobotsTxt, 3.0.3"
#:package Crumpled.RobotsTxt@3.0.3
#addin nuget:?package=Crumpled.RobotsTxt&version=3.0.3
#tool nuget:?package=Crumpled.RobotsTxt&version=3.0.3
Crumpled.RobotsTxt
A flexible, configuration-driven robots.txt solution for Umbraco v13, v14, v15, v16 & v17 that protects your non-production environments from search engine indexing by default, while giving you granular control over crawling rules across multiple sites and environments.
Key Features
- π‘οΈ Safe by Default - Blocks all bots by default to prevent accidental indexing of development, staging, or preview environments
- π Multi-Site & Environment-Aware - Configure different robots.txt rules for different domains/hostnames and environments (Production, Development, Staging, etc.)
- π Flexible Rule Configuration - Define reusable rulesets with Allow/Disallow patterns for different user agents
- πΊοΈ Sitemap Integration - Include sitemap URLs per site
- βοΈ Umbraco Cloud Ready - Default behaviour designed for Umbraco Cloud - Perfect for hiding those often overlooked *.umbraco.io environment domains.
- βοΈ Zero Code Setup - Works out of the box with auto-registration
Install NuGet package
dotnet add package Crumpled.RobotsTxt
Setup
The package automatically registers itself via a Umbraco Composer. No code changes required!
Manual Registration (Advanced)
If you prefer to manually register the package in program.cs, disable the composer:
"Crumpled": {
"RobotsTxt": {
"DisableComposer": true
}
}
Then add to your program.cs:
.AddCrumpledRobotsTxt()
Default Behavior - Protection First
The package prioritizes protecting your content from unintended indexing. When no Sites are configured, smart defaults kick in:
Custom Default: If you specify a
DefaultRuleset, that ruleset will be used as the fallbackUmbraco Cloud Live Environment: If the environment variable
UMBRACO__CLOUD__DEPLOY__ENVIRONMENTNAMEequals"live", all bots are allowed by default:User-agent: * Allow: /All Other Environments: All bots are blocked by default for safety - protecting staging, development, and preview environments:
User-agent: * Disallow: /
β οΈ Note: Once you configure Sites, these defaults are ignored and your custom RuleSets take full control.
Unmatched Domains - Additional Protection
When Sites are configured, any domain that doesn't match the configured HostNames (e.g., temporary preview URLs, forgotten subdomains) will get a protective fallback:
- Custom Default: If you specify a
DefaultRuleset, that ruleset will be used - Otherwise: Blocks all bots for safety:
User-agent: * Disallow: /
This prevents unintended crawling of staging, preview, or other unlisted domains - ensuring only your explicitly configured production domains are indexed.
Configuration Example - Multi-Site Setup
Configure different robots.txt rules for different environments and domains using reusable rulesets:
"Crumpled": {
"RobotsTxt": {
"DefaultRuleset": "NonProduction",
"RuleSets": { // There can be multiple rulesets for complex scenarios!
"Production": {
"Allow": {
"*" : ["/"]
},
"Disallow": {
"*": [ "/cdn-cgi/challenge-platform/", "/cdn-cgi/email-platform/" ]
}
},
"NonProduction": {
"Allow": {
"SemrushBot": [ "/" ],
"SemrushBot-SA": [ "/" ],
"SemrushBot-Desktop": [ "/" ],
"SemrushBot-Mobile": [ "/" ],
"SiteAuditBot": [ "/" ]
},
"Disallow": {
"*": [ "/" ]
}
}
},
"Sites": {
"Prod": {
"HostNames": "www.mysite.com",
"SiteMapDomain": "www.mysite.com",
"RuleSet": "Production"
},
"AnotherProd": {
"HostNames": "www.anothermysite.com",
"SiteMapDomain": "www.anothermysite.com",
"RuleSet": "Production" // or can define alternate production ruleset for this site
},
"Stage": {
"HostNames": "mysite-staging-uksouth01.umbraco.io,staging.mysite.com",
"SiteMapDomain": "staging.mysite.com",
"RuleSet": "NonProduction"
},
"Dev": {
"HostNames": "mysite-dev-uksouth01.umbraco.io,dev.mysite.com",
"SiteMapDomain": "dev.mysite.com",
"RuleSet": "NonProduction"
}
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Umbraco.Cms.Web.Website (>= 13.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.