We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53162
    • 15 Posts
    Thanks, had a look in there and it has:

    auto_prepend_file: no value


    Guessing that is what it should be?
      • 3749
      • 24,544 Posts
      As a last resort, you could try removing the space with a plugin attached to OnWebPagePrerender. If it doesn't work, it means the space isn't coming from MODX or the sitemap plugin, in which case auto-
      -file is a more likely culprit.

      This code in the plugin should do it:

      $modx->resource->_output = ltrim($modx->resource->_output);
      return'';


      If that works, you might want to restrict execution to just the sitemap resource like this:

      if ($modx->resource->get('id') == 12) {  // Change to ID of your sitemap resource
          $modx->resource->_output = ltrim($modx->resource->_output);
      }
      return'';
      [ed. note: BobRay last edited this post 7 years, 2 months ago.]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 37105
        • 194 Posts
        Just to check if the extra Google Sitemap is the problem you can try the snippet pdoSitemap available in extra pdoTools.
        See https://docs.modx.pro/en/components/pdotools/snippets/pdositemap
          Codeplaza Webdesign: for professional websites at low cost
          • 53162
          • 15 Posts
          Thanks BobRay for the suggestion, didn't seem to work though. Granted I'm quite new to MODx so might not have done it correctly as I've never added a plugin before. Added one with the bit of code you gave and added the OnWebPagePrerender system event in the System Events tab.

          Thanks Don for the suggestion too, but it's definitely not a plugin causing the blank line as I uninstalled them all to see if it fixed it (one by one and clearing the cache after uninstalling each just to be sure) and there was still the blank line there.

          Have auto_prepend_file set to
          ; auto_prepend_file =
          now too so have it commented out just to be safe.
            • 3749
            • 24,544 Posts
            Check phpinfo() (which you can do in the Manager, IIRC under Reports -> System Information -- it's a small link you might not notice at first) to make sure you're looking at the right php.ini file. phpinfo() will list the path to the php.ini it's using.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 53162
              • 15 Posts
              Ah, I was updating the wrong php.ini file for that. Commented out the one it said is being used though and it still didn't work sad

              Thanks for the suggestion though BobRay!