Enable Simple XML Sitemap (Search engines) in SEO Tools recipe

Created on 17 February 2025, 3 months ago

Problem/Motivation

We have been working hard to implement the ping protocol as well as the new IndexNow protocol in simple_sitemap_engines (a submodule of simple_sitemap). These make sure to submit site changes directly to search engines for faster indexation. I believe users relying on the SEO tools recipe to configure their SEO are missing out on this crucial feature which is why I'm advocating to add it to the recipe.

Steps to reproduce

  • Install Drupal CMS with SEO tools recipe
  • Notice simple_sitemap_engines not being enabled

Proposed resolution

  1. Enable the simple_sitemap_engines module via the SEO Tools receipe
  2. Work is on its way to configure simple_sitemap on recipe install; let's configure the submodule accordingly: ๐Ÿ“Œ Add Simple XML Sitemap defaults for content types, menu and vocabulary Active

User interface changes

Data model changes

Possible challenges

The IndexNow protocol which is in the process of replacing the ping protocol needs a verification key. The module provides a means of generating that key into state and informs about the possibility of converting it to a settings value. We may want to generate that key on module install - I can implement it upstream, or we do it in the recipe. Alternatively we don't do anything and leave it to the user (a warning about the missing key with a link is being displayed after module install).

I'm happy to work together with you on this. :)

๐Ÿ“Œ Task
Status

Active

Component

Track: SEO

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany gbyte Berlin

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

Comments & Activities

  • Issue created by @gbyte
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kkalashnikov Ghaziabad, India

    kunalgautam โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kkalashnikov Ghaziabad, India
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    @kunalgautam

    simple_sitemap_engines is a submodule of drupal/simple_sitemap.

    This line in the composer.json file should be removed as it is not needed. The submodule gets required when drupal/simple_sitemap is required.

    "drupal/simple_sitemap_engines": "^4.2.2",

    @gbyte How is the key generated, and how is it saved? I assume we can use config actions in a recipe to save it, but not sure how a recipe could generate the key.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany gbyte Berlin

    @gbyte How is the key generated, and how is it saved? I assume we can use config actions in a recipe to save it, but not sure how a recipe could generate the key.

    After module installation

    The IndexNow functionality is not available as long as the below requirement is not met.

    Requirement warning

    Another warning on the module's settings page

    After key generation

    Klicking 'Generate verification key' saves a new key to Drupal state. We generate the key through \Drupal::service('uuid')->generate() .

    A nudge to move the key to settings.php

    After moving the key to settings.php

    A nudge and facility to delete the key from state

    I think this explains the process. I think the easiest and least invasive would be to generate the key and put it into state with SimpleSitemapEnginesForm::generateKey() - a user's key in settings.php would override that automatically generated key anyway.

    The upside of an automatically generated key would be the user not needing to check requirements and pressing a button.
    The downside being dev environments would start sending index requests to IndexNow.

    If we go ahead with automatic generation, we have to decide if the upstream module should generate that key on module install or if Drupal CMS should do it.

    What do you think?

Production build 0.71.5 2024