Closed porg closed 4 months ago
@porg We do have a prime cache feature that can cache a specified sitemap URL -- wp-admin/admin.php?page=w3tc_pgcache
We do not have plans to make a sitemap converter (TXT to XML). WordPress redirects common sitemap URL requests to either wp-sitemap.xml
or ?sitemap=index
; see https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/sitemaps/class-wp-sitemaps-index.php#L78-L96 -- We prefer to let WordPress handle sitemaps. If you want to override it, there are sitemap plugins that may be useful. If you place your sitemap file in your filesystem, then WordPress should not redirect to its dynamically generated wp-sitemap.xml
file.
Thanks for your answer.
Among the points you addressed, you also wrote:
We do not have plans to make a sitemap converter (TXT to XML)
As I pointed out plaintext is a valid sitemap format per the sitemap.org spec. So why not support it? That reason I'd like to know.
For learning/debugging the Cache Preload cycle, working with a plain text
sitemap.txt
would be so much easier. Please support this in W3TC!Reasoning
This has official backing! Because the official SiteMap specification under Other Formats lists Text File as a valid option:
Minimal sitemaps (URL only) in TXT or XML format are essentially the same
Because in the XML tag definitions it is clearly stated that per
<url>
tag the only mandatory tag is a<loc>
tag. Which is essentially the same as a plain text sitemap with one URL per line.In your plain text:
At file start insert:
At file end insert:
Change the file extension from TXT to XML.
Et Voila: You have a valid XML sitemap. Mine validated positive.
In the learning/debugging session which by itself is anyhow unnerving admins sure would be happy to spare themselves that extra conversion effort and just work with a simple one URL per line
sitemap.txt
What do you say?