Skip to content

XML Sitemaps integration #15302

@jdevalk

Description

@jdevalk

We want to let the Yoast SEO XML sitemaps run on indexables as this will perform much better. Some of the work needed for this is already done in the jdv/xml-sitemaps branch, see its changes compared to trunk.

As soon as a site has completed indexing, the current XML sitemaps code (henceforth known as “classic XML sitemaps”) should no longer be loaded. Instead the new XML sitemaps code (henceforth: "XML sitemaps integration") should be loaded.

The XML sitemaps for Yoast SEO should remain functionally the same regardless of which of them runs.

We'll also add a feature toggle that allows switching to classic XML sitemaps, so users can force the old implementation with multilingual solutions that are not compatible.

Code parts of the XML sitemaps integration

All of the code in classic XML sitemaps should have a counterpart in the XML sitemaps integration.

  • Conditional
    Allows only loading stuff on XML sitemap requests. Already done, in branch.
  • Integration
    Takes care of adding query vars and registering the rewrites. Already done, in branch.
    Takes care of other XML sitemaps code that has no other logical place.
  • Router
    Takes care of routing to the right xml sitemap presenter (through template_redirect, I think)
    Uses Routes, which are a simple mapping of urls to presenters. Similar like we did here. Some of the pre-work for this is already done, as this required making sure Routes are loaded for every request, adding a REST conditional
  • Presenters
    We should build an abstract presenter, that the normal presenters build upon. The index presenter probably can't use that abstract.
    • Post type
    • Taxonomy
    • Author
    • Index

Images

Images in the XML sitemaps are taken from the internal linking table. Therefore we no longer need to parse every post. All the images and all the URLs for a sitemap should be grabbed in one find_many call.

Tasks

  • Build the conditional.
  • Make routes work on all requests.
  • Make sure the router routes to a presenter.
  • Build sitemap index presenter.
  • Build abstract sitemap presenter.
  • Build post type presenter.
  • Build taxonomy presenter.
  • Build feature toggle.

Metadata

Metadata

Assignees

No one assigned

    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