Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sitemap should contain canonical URLs, not permalinks #648

Open
sybrew opened this issue Oct 10, 2023 · 0 comments
Open

Sitemap should contain canonical URLs, not permalinks #648

sybrew opened this issue Oct 10, 2023 · 0 comments
Labels
[Component] Sitemap [Type] Enhancement Improves anything we already have.

Comments

@sybrew
Copy link
Owner

sybrew commented Oct 10, 2023

From dracoteam's comments:

The sitemap currently outputs permalinks. These permalinks may not always be canonical. Typically, it's only different when a user enters a custom URL.

Google considers the URLs in the sitemap canonical. However, the canonical URL tag, which TSF forcefully outputs (almost) everywhere, will override this treatment.

The biggest hurdle with changing from permalinks to canonical URLs is the database lookups, which are perpendicular to the number of URLs in the sitemap (up to 50,000). Moreover, we need to validate all URLs for the scheme settings: If the URL matches the site's domain, the scheme will be forced.

To work around this, we could fetch all custom canonical URLs in a single query, but this adds complexity in validating the URLs.

Only when PHP gets multithreading should we consider this. In the meantime, we could provide an advanced toggle: "Use a more "correct" sitemap at the expense of system resources?"

@sybrew sybrew added [Type] Enhancement Improves anything we already have. [Component] Sitemap labels Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Sitemap [Type] Enhancement Improves anything we already have.
Projects
None yet
Development

No branches or pull requests

1 participant