Support sitemap link generation from raw XML files

Created on 6 June 2025, 1 day ago

Problem/Motivation

We want to support the inclusion of sitemap links for content that lives outside of Drupal, such as in external systems or Single Page Applications (SPAs). These external data sources often cannot be directly integrated into Drupal's content model, but it's still important for their URLs to be discoverable by search engines via the sitemap.

Allowing manually entered XML data provides a flexible way for site administrators to include these external links without requiring complex integrations or automated endpoint traversal.

Proposed resolution

Introduce a new feature that allows users to paste raw XML sitemap content into a configurable text field. The module will then parse the inputted XML and generate sitemap links based on it. This allows teams to manually manage and update external URLs in the sitemap without requiring automated API integration.

Key capabilities would include:

  • A configurable textarea field in the admin UI for pasting raw XML.
  • Parsing logic to extract URLs from the pasted XML.
  • Validation to ensure the XML is well-formed and adheres to the expected sitemap format.
  • Integration with the sitemap generation system to include these links.

Tasks

  • Define expected XML format (e.g., standard sitemap structure).
  • Add admin configuration form with a textarea for XML input.
  • Implement XML parsing and link extraction.
  • Validate and sanitize input.
  • Integrate parsed links into sitemap generation.
  • Add tests and documentation.

User interface changes

  • New textarea input for pasting XML sitemap content in the admin configuration UI.
  • Inline validation and feedback if malformed XML is entered.
✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States edwardchiapet New York, NY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024