How to create sitemaps with only non-www URLs in MediaWiki website?

by Arnb   Last Updated May 05, 2018 13:04 PM - source

I usually prefer the non-www URL for my website (, not While submitting the site to Google one needs to set a preferred domain by choosing either the www or the non-www version of URL. Then, during submitting the sitemap, only the sitemap containing the preferred version of URL should be submitted to Google search console.

I have a website run by MediaWiki software. It uses a PHP script (named generateSitemap.php, it is bundled with the MediaWiki installation package) to create the sitemaps. One can set cron jobs to automate the process of updating sitemap at regular intervals.

The problem is my sitemap are being generated containing the www version of the webpages.

How should I instruct the programs to generate sitemaps without www in the URLs? Please help.

Related Questions

Major content mismatch issue detected for my site?

Updated February 07, 2018 21:04 PM