Configures XML sitemaps in Orchard Core: content type and custom path sources, sitemap indexes, localized hreflang, caching, robots.txt integration, and decoupled Razor Pages.
Ships in orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Generate sitemap configurations, sitemap index setups, and SitemapPart configurations for Orchard Core.
OrchardCore.Sitemaps (depends on OrchardCore.Contents) for XML sitemap generation. Manage them under Tools > Search Engine Optimization > Sitemaps / Sitemap Indexes / Sitemaps Cache; this requires the ManageSitemaps permission (SitemapsPermissions.ManageSitemaps).ContentTypesSitemapSource) or Sitemap Custom Path (CustomPathSitemapSource) for a fixed URL.ISitemapSourceFactory (SitemapSourceFactory<TSource>, named after the source class). The add-source URL SitemapSource/Create/{sitemapId}/{sourceType} matches the type case-insensitively (a lowercase URL returned 404 before #20337) and saves the factory's exact name..xml (e.g., sitemap.xml) and are unique; the admin validates this, recipes do not, so always use .xml in recipes too.AutoroutePart are listed for inclusion by default. To include content routed another way, implement IRouteableContentTypeProvider.SitemapPart to a content type for per-item control (override priority, change frequency, or exclude items). It is optional.0-10 (5 renders as 0.5).OrchardCore.ContentLocalization.Sitemaps (Localized Content Item Sitemaps) for hreflang alternates of localized items.OrchardCore.Sitemaps.RazorPages (Sitemaps for Decoupled Razor Pages) for Razor Page routes.wwwroot/{tenant}/sm-cache and auto-cleared on publish. OrchardCore.Sitemaps.Cleanup adds the Sitemap Cache Cleaner background task (every 5 minutes) that removes stale cache files.OrchardCore.Seo and OrchardCore.Sitemaps are enabled, sitemap and sitemap index URLs are added to robots.txt./{**sitemap}). In Orchard Core 4.0 dynamic routes no longer break named link generation for [EndpointName] API actions.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Sitemaps"
],
"disable": []
}
]
}
{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Sitemaps",
"OrchardCore.ContentLocalization",
"OrchardCore.ContentLocalization.Sitemaps"
],
"disable": []
}
]
}
Sitemaps Recipe StepThe Sitemaps step (also produced by the All Sitemaps deployment step) takes a data array of polymorphic sitemap documents. Every sitemap and every source needs a $type discriminator:
| Object | $type |
|---|---|
| Sitemap | OrchardCore.Sitemaps.Models.Sitemap, OrchardCore.Sitemaps.Abstractions |
| Sitemap index | OrchardCore.Sitemaps.Models.SitemapIndex, OrchardCore.Sitemaps |
| Content types source | OrchardCore.Sitemaps.Models.ContentTypesSitemapSource, OrchardCore.Sitemaps.Abstractions |
| Custom path source | OrchardCore.Sitemaps.Models.CustomPathSitemapSource, OrchardCore.Sitemaps.Abstractions |
| Index source | OrchardCore.Sitemaps.Models.SitemapIndexSource, OrchardCore.Sitemaps |
The easiest way to get exact JSON is to configure sitemaps in the admin and export them with a deployment plan.
{
"steps": [
{
"name": "Sitemaps",
"data": [
{
"$type": "OrchardCore.Sitemaps.Models.Sitemap, OrchardCore.Sitemaps.Abstractions",
"SitemapId": "pagessitemap",
"Name": "Pages",
"Path": "sitemap-pages.xml",
"Enabled": true,
"SitemapSources": [
{
"$type": "OrchardCore.Sitemaps.Models.ContentTypesSitemapSource, OrchardCore.Sitemaps.Abstractions",
"Id": "pagessource",
"IndexAll": false,
"LimitItems": false,
"ChangeFrequency": "Daily",
"Priority": 5,
"ContentTypes": [
{
"ContentTypeName": "Page",
"ChangeFrequency": "Weekly",
"Priority": 8
},
{
"ContentTypeName": "BlogPost",
"ChangeFrequency": "Daily",
"Priority": 6
}
]
},
{
"$type": "OrchardCore.Sitemaps.Models.CustomPathSitemapSource, OrchardCore.Sitemaps.Abstractions",
"Id": "contactsource",
"Path": "contact",
"ChangeFrequency": "Monthly",
"Priority": 4
}
]
}
]
}
]
}
ContentTypesSitemapSource properties: IndexAll (default true, uses the source-level ChangeFrequency/Priority for all routable types), ContentTypes (per-type entries when IndexAll is false), LimitItems, and LimitedContentType (ContentTypeName, ChangeFrequency, Priority, Skip, Take) when LimitItems is true.
{
"steps": [
{
"name": "Sitemaps",
"data": [
{
"$type": "OrchardCore.Sitemaps.Models.SitemapIndex, OrchardCore.Sitemaps",
"SitemapId": "mainindex",
"Name": "Sitemap Index",
"Path": "sitemap.xml",
"Enabled": true,
"SitemapSources": [
{
"$type": "OrchardCore.Sitemaps.Models.SitemapIndexSource, OrchardCore.Sitemaps",
"Id": "mainindexsource",
"ContainedSitemapIds": [
"pagessitemap",
"articles1",
"articles2"
]
}
]
}
]
}
]
}
{
"steps": [
{
"name": "Sitemaps",
"data": [
{
"$type": "OrchardCore.Sitemaps.Models.Sitemap, OrchardCore.Sitemaps.Abstractions",
"SitemapId": "articles1",
"Name": "Articles 1",
"Path": "sitemap-articles-1.xml",
"Enabled": true,
"SitemapSources": [
{
"$type": "OrchardCore.Sitemaps.Models.ContentTypesSitemapSource, OrchardCore.Sitemaps.Abstractions",
"Id": "articles1source",
"IndexAll": false,
"LimitItems": true,
"LimitedContentType": {
"ContentTypeName": "Article",
"ChangeFrequency": "Weekly",
"Priority": 5,
"Skip": 0,
"Take": 50000
}
}
]
},
{
"$type": "OrchardCore.Sitemaps.Models.Sitemap, OrchardCore.Sitemaps.Abstractions",
"SitemapId": "articles2",
"Name": "Articles 2",
"Path": "sitemap-articles-2.xml",
"Enabled": true,
"SitemapSources": [
{
"$type": "OrchardCore.Sitemaps.Models.ContentTypesSitemapSource, OrchardCore.Sitemaps.Abstractions",
"Id": "articles2source",
"IndexAll": false,
"LimitItems": true,
"LimitedContentType": {
"ContentTypeName": "Article",
"ChangeFrequency": "Weekly",
"Priority": 5,
"Skip": 50000,
"Take": 50000
}
}
]
}
]
}
]
}
ChangeFrequency is an enum serialized as a string: Always, Hourly, Daily, Weekly, Monthly, Yearly, Never. It is written lowercase in the XML (<changefreq>daily</changefreq>).
Attach SitemapPart to a content type for per-item sitemap control. Its stored properties:
| Property | Description |
|---|---|
OverrideSitemapConfig | Enable per-item overrides. |
Exclude | Exclude the content item from the sitemap entirely. |
Priority | Per-item priority (0-10, default 5). |
ChangeFrequency | Per-item change frequency (default Daily). |
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
namespace MyModule;
public sealed class SitemapMigrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public SitemapMigrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentTypeName}}", type => type
.WithPart("SitemapPart", part => part
.WithPosition("10")
)
);
return 1;
}
}
{
"steps": [
{
"name": "ContentDefinition",
"ContentTypes": [
{
"Name": "{{ContentTypeName}}",
"DisplayName": "{{DisplayName}}",
"ContentTypePartDefinitionRecords": [
{
"PartName": "SitemapPart",
"Name": "SitemapPart",
"Settings": {
"ContentTypePartSettings": {
"Position": "10"
}
}
}
]
}
]
}
]
}
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Models;
using OrchardCore.Sitemaps.Builders;
using OrchardCore.Sitemaps.Services;
namespace MyModule.Sitemaps;
public sealed class ProductRouteableContentTypeProvider : IRouteableContentTypeProvider
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public ProductRouteableContentTypeProvider(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<IEnumerable<ContentTypeDefinition>> ListRoutableTypeDefinitionsAsync()
{
var definition = await _contentDefinitionManager.GetTypeDefinitionAsync("Product");
return definition is null ? [] : [definition];
}
public Task<string> GetRouteAsync(SitemapBuilderContext context, ContentItem contentItem)
{
if (contentItem.ContentType != "Product")
{
return Task.FromResult<string>(null);
}
return Task.FromResult(context.HostPrefix + context.UrlHelper.Content($"~/products/{contentItem.ContentItemId}"));
}
}
Register it with services.AddScoped<IRouteableContentTypeProvider, ProductRouteableContentTypeProvider>();.
SitemapBuilderContext.HostPrefix is the scheme and host without a trailing slash: its setter trims a trailing / (as in a Base URL site setting of https://example.com/), so appending a root-relative path never produces //. Append paths that start with /.
Enable OrchardCore.Sitemaps.RazorPages, then configure routes in Program.cs:
builder.Services.Configure<SitemapsRazorPagesOptions>(options =>
{
options.ConfigureContentType("{{ContentTypeName}}", o =>
{
o.PageName = "{{RazorPageName}}";
o.RouteValues = (contentItem) => new
{
area = "OrchardCore.Sitemaps",
slug = contentItem.ContentItemId
};
});
});
Always include the area in the route values.
When both OrchardCore.Seo and OrchardCore.Sitemaps are enabled and no static robots.txt exists on the filesystem, sitemap index and sitemap URLs are added to the generated robots.txt. Toggle this at Settings > Search > Search Engine Optimization > Robots or with the settings step:
{
"steps": [
{
"name": "settings",
"SitemapsRobotsSettings": {
"IncludeSitemaps": true
}
}
]
}
wwwroot/{tenant}/sm-cache and cleared automatically when content items are published or sitemaps change.OrchardCore.Sitemaps.Cleanup to remove orphaned cache files periodically.OrchardCore.Sitemaps.Permissions.ManageSitemaps was removed. Use OrchardCore.Sitemaps.SitemapsPermissions.ManageSitemaps (in OrchardCore.Sitemaps.Abstractions). Role claims are unchanged.AdminList shape (List/Grid layouts, page size selection) and breadcrumbs; re-check overridden admin list views.Official Orchard Core videos shown on the documentation page:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/orchardcore:orchardcore-sitemapsfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard.Other plugins' skills for the same job