Custom URL for sitemap

My site hosted with wordpress and I’m using jetpack. Is it possible to create custom URL for sitemap instead of the default /sitemap.xml URL?

  • Kris
    • Support

    Hi Ratnesh

    Hope you are doing good today.

    I’m afraid there is no easy way to change sitemap.xml path and name in any plugin including Jetpack and SmartCrawl because there ise to many rules to change on core files on those plugins.

    If you will have custom sitemap.xml file, not generate by any plugin then you could simply rename that file and include that sitemap adding custom code to your site header.

    However I ask our SLS Team about this and we will post an update here as soon as more information is available.

    Please keep in mind that our SLS Team deals with more complicated issues, so it may take a little longer for them to reply here. Thank you for your patience while we look into this further.

    Kind Regards,

    Kris

  • Alessandro
    • Staff

    Hi Ratnesh,

    Sorry for my late response. We created a fix for you, so you can create a custom url for your sitemap.

    You can add the above snippet in a mu-plugin. If you are not familiar with mu-plugins, you can read more about them here:

    https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    You can download you plugin here:

    https://gist.github.com/wpmudev-sls/c97591fc1359d9ea7bf05d6b9f39472a

    By clicking Download ZIP on the upright part, then unzip and upload it to your mu-plugins directory.

    Before uploading the file, make sure that you edit it and replace demo.xml with your desired name. (Default: sitemap.xml)

    define('WPMUDEV_SITEMAP_SLUG', 'demo.xml');

    If you experience any problems regarding this snippet, do not hesitate to ping us back. :grinning:

    Hope this helps!

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.