• Resolved quinncooper88

    (@quinncooper88)


    I am trying to set up the SEO plugin and having issues with the sitemap. Under Settings, I enabled XML Sitemaps, but when I select “view the XML sitemap”, the sitemap_index.xml link just displays an error message that says:

    This page contains the following errors:
    error on line 2 at column 6: XML declaration allowed only at the start of the document Below is a rendering of the page up to the first error.


    The link is https://helpinghandscounselling.com/sitemap_index.xml
    I checked the source code but couldn’t figure out what’s happening.

    I’m using the WP Super Cache plugin and have tried disabling the caching until I figure this out. I previously tried deleting the cache which didn’t help.

    I saw a previous post where someone had a similar issue, so I tried increasing my PHP memory limit from 256 to 512, but that didn’t work either.

    Hosting: GreenGeeks
    WP version: 7.0
    Yoast version: 27.9

    • This topic was modified 1 month, 1 week ago by quinncooper88. Reason: Added version numbers and a few things I've tried
    • This topic was modified 1 month, 1 week ago by quinncooper88.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Jose Varghese

    (@josevarghese)

    Hi @quinncooper88

    Thanks for using Yoast SEO plugin and for creating the thread. We understand that you are noticing the error “error on line 2 at column 6: XML declaration allowed only at the start of the document” while opening the sitemap. We can see how this might give you pause. We are happy to take a look! Let’s see what is going on.

    An empty whitespace or a blank line appears due to a conflict with another plugin or your theme. Usually, there is an empty space or a blank line before or after the closing PHP opening or closing tag, which shouldn’t be there. In your case, the first line of the sitemap and all the pages source code are having a blank line is causing this issue. See screenshot for your reference: https://ibb.co/R468ySrC

    You can narrow down the exact source of conflict by performing a conflict check. Once you have identified whether your theme or a plugin causes the issue, please contact the developers of that theme or plugin for assistance in finding and removing the white space.

    Thread Starter quinncooper88

    (@quinncooper88)

    I installed the Health Check & Troubleshooting plugin and it says these are the issues under Site Health > Status:
    – One or more recommended modules missing: PHP modules perform most of the tasks on the server that make your site run. Any changes to these must be made by your server administrator. The WordPress Hosting Team maintains a list of those modules, both recommended and required, in the team handbook(opens in a new tab). Warning The optional module, imagick, is not installed, or has been disabled.
    – Opcode cache is not enabled: Opcode cache improves PHP performance by storing precompiled script bytecode in memory, reducing the need for PHP to load and parse scripts on each request. Enabling this cache can significantly improve the performance of your site.

    I should also point out that I’m using a custom block theme (using Create Block Theme plugin). And I also built some custom blocks, but I don’t see anything in them that would be causing this issue.


    Thread Starter quinncooper88

    (@quinncooper88)

    I looked through all my php files (functions.php, hhc-blocks.php, blocks-manifest.php etc) to see if any of the php opening tags had whitespace and they don’t nor do they have closing php tags.

    Thread Starter quinncooper88

    (@quinncooper88)

    Okay I fixed the missing modules. I enabled imagik in my cPanel settings. That still doesn’t fix the issue. I have these plugins: ACF Pro, WP Migrate Pro, Regenerate Thumbnails, Reveal IDs, Sure Forms, Sure Mail, WP Super Cache (I have tried deleting the cache and deactivating this plugin), and Health Check & Troubleshooting.

    Thread Starter quinncooper88

    (@quinncooper88)

    Still having issues 🙁
    I disabled all the plugins. That didn’t help

    Plugin Support Maybellyne

    (@maybellyne)

    Given the nature of the issue, we’ll need to look at your setup. However, we are unable to do it here as this is a public forum. You could consider purchasing a Yoast SEO Premium subscription, as it includes email support. Then we can investigate the issue further, directly on your setup, privately.

    Thread Starter quinncooper88

    (@quinncooper88)

    I can’t afford that

    Thread Starter quinncooper88

    (@quinncooper88)

    Just wanted to give an update. I figured it out. I had a closing php tag in my hhc-blocks.php file. Removed that and now the site map works! Thank you everyone who replied.

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.