Skip to content

Sitemap includes non-content files (assets, scripts, robots.txt) #1024

@stephanoodle

Description

@stephanoodle

Context

While fixing a sitemap 500 error on the support site (dnsimple/dnsimple-support#1958), @weppos flagged that both sites should be kept in sync. This issue tracks the equivalent problem on the developer site.

What's wrong

The live sitemap at https://developer.dnsimple.com/sitemap includes non-content files that should not be indexed:

  • assets/css/style.css
  • assets/images/border.jpg (and 15+ other image files)
  • ddns/ddns.sh
  • robots.txt
  • llms.txt
  • v2/openapi.yml
  • The sitemap page itself (/sitemap)

These inflate the sitemap with low-value URLs and can signal poor sitemap quality to crawlers.

Additionally, all entries share the same lastmod date (2026-05-25), which reflects the last deploy timestamp rather than actual content changes. Google has said it ignores or distrusts lastmod when it appears inaccurate or uniform across all URLs — which is exactly the case here.

What already exists

lib/default.rb has a sitemap_items helper that's already doing some filtering — it excludes is_hidden items and the /v2/platform/ subtree. The fix builds on that by also excluding items that don't resolve to page URLs.

Suggested fix

In lib/default.rb, update sitemap_items to reject items whose path is nil or doesn't end with / (pages on this site use trailing-slash URLs; assets and files resolve to extensions):

def sitemap_items
  @items.reject do |item|
    item[:is_hidden] ||
      platform_sitemap_excluded?(item.identifier.to_s) ||
      item.path.nil? ||
      !item.path.end_with?('/')
  end
end

This would keep all legitimate content pages (/v2/domains/, /getting-started/, etc.) while excluding CSS, images, scripts, text files, and the sitemap itself.

References

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions