Skip to content

Sitemap issue with Polylang #675

@saulirajala

Description

@saulirajala

The language version of sitemaps is not accessible via domain.com/lang_slug/sitemap.xml, if “The front page URL contains the language code instead of the page name or page id” -setting is not enabled in Polylang Pro. This settings controls whether the frontpage is located in domain.com/lang_slug/ or in domain.com/lang_slug/page-title/.

If the url of frontpage is domain.com/lang_slug/page-title/ then the sitemap can be found in domain.com/lang_slug/page-title/sitemap.xml. Yet the domain.com/lang_slug/sitemap.xml is advertised in robots.txt:

Sitemap: https://domain.com/sitemap.xml
Sitemap: https://domain.com/lang_slug/sitemap.xml

I tested the issue both with Polylang Pro and Polylang You can replicate the issue by creating a new site with two languages. I have following settings in Polylang

  • The language is set from the directory name in pretty permalinks
  • Hide URL language information for default language
  • Remove /language/ in pretty permalinks

Original issue in wordpress.org: https://wordpress.org/support/topic/sitemap-issue-with-polylang/

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions