No internet connection
  1. Home
  2. Support

Yoast Sitemap URL not being replaced

By Kaitlyn Thul @kaitlyn2019-01-07 19:13:38.879Z

I absolutely love this plugin, and have successfully exported my site several times. Thank you! I have noticed an issue - which may be my fault or an issue with the plugin - not quite sure.

When exporting my site locally (via zip or subdirectory), WP2Static is successfully grabbing all my sitemap files (ex: sitemap_index.xml). However, there is a URL inside this file (first line) which is not replaced with the destination URL (

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//joy-media.local/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>

The href attribute URL is still pulling my local domain, rather than the destination URL.

Is this something I can fix within the plugin settings or do you have any suggestions on how to fix?

Thank you!

Solved in post #6, click to view
  • 6 replies
  1. Leon Stafford @leonstafford2019-01-07 19:28:02.711Z

    Hi Kaitlyn,

    Thanks for using the plugin and glad it's working well for you!

    Looking at that link, I think it may be a big in the plugin not detecting/properly rewriting the "protocol relative URL", ie a URL starting with // vs http or https.

    Is this a Yoast generated sitemap or another?

    If you can override that and use a protocol specific URL, starting with http or https (whichever your dev site uses), this should be properly rewritten.

    Please let me know if having any issues trying to change that and will do my best to help.



    1. KKaitlyn Thul @kaitlyn2019-01-07 19:34:50.958Z

      Yep - this is an auto-generated Yoast sitemap - I'm not sure I have any way to edit it.

      I could manually go in and change that URL every time after I export the site, but that would be a hassle. Is there a way to add a custom rewrite for this URL type within WP2Static settings?

      1. Leon Stafford @leonstafford2019-01-08 16:23:56.787Z

        Hi Kaitlyn,

        Sorry for the delayed response, having a rainy slow day here.

        I've created an issue here which I'll get out in the next release, with a few other small bugfixes.

        Any of those protocol relative links should be getting rewritten everywhere. They used to be caught with a different method in earlier versions of the plugin, but that particular area was improved(?) to fix a few other things, automatic tests weren't there to catch the breakage it seems to have caused for this type of link.

        I'll get that sorted and try to get more auto-tests in to ensure all rewrite functionality remains consistent between releases.



        1. KKaitlyn Thul @kaitlyn2019-01-08 22:11:37.235Z

          No worries, thank you for the update!

          1. Leon Stafford @leonstafford2019-01-26 20:02:30.219Z

            Hi Kaitlyn,

            Thanks for your patience with this.

            Could you please try this latest development build attached and let me know if that gets your URL rewriting properly in the sitemap?



   (147.63 kB)

            1. KKaitlyn Thul @kaitlyn2019-01-28 15:20:17.140Z

              I just tested this with your newest version (6.5.1) and it works - thank you!