Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1389730

    Eric
    Participant

    Hey I’m trying to set up my settings with Yoast SEO to help optimize my website, and I noticed when trying to view my XML sitemaps that I’m getting this error message:

    “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.”

    I did some research and I was told that there may be a mistake within the PHP file but I can’t seem to figure it out.

    Any idea as to what can be causing this?

    Thanks in advance!

    #1389731

    Eric
    Participant
    This reply has been marked as private.
    #1389983

    Christian
    Moderator

    Hey there,

    To know if X is causing this issue, please backup your site and switch to the default WordPress theme then check if the issue persists. If it does, please give us access to your FTP also.

    Thanks.

    #1390352

    Eric
    Participant
    This reply has been marked as private.
    #1390496

    Christian
    Moderator

    Sorry but we’re not sure if this is an issue with X yet and that is the quickest way to know if the problem is with X. Since it is not possible with your live site, please copy your site over to a staging server and give us a link to your XML sitemap.

    I have Yoast SEO XML sitemap on my test site and I don’t get that error.

    Thanks.

    #1390509

    Eric
    Participant
    This reply has been marked as private.
    #1391086

    Eric
    Participant
    This reply has been marked as private.
    #1391202

    Rad
    Moderator

    Hi there,

    It’s because of code in your child theme’s functions.php

    <?php endif; }
    add_action( 'wp_footer', 'my_custom_footer_output', 30 ); ?>
    
    <?php
    
    function x_entry_navigation() {

    It should be like this

    <?php endif; }
    add_action( 'wp_footer', 'my_custom_footer_output', 30 ); 
    
    function x_entry_navigation() {

    Don’t need to add ?> and <?php with space in between.

    I went ahead and fixed it.

    Thanks!

    #1391318

    Eric
    Participant

    Wow great it works perfectly now. Thanks a lot!

    You guys are the best.

    #1391349

    Eric
    Participant

    Actually while on the subject, I was hoping I could ask one last follow-up question.

    I recently changed my domain and I was told that I needed to perform the ‘change of address’ in google’s search console to finalize the move, and I was just wondering how important it is to actually perform this change of address? I decided to do it a few days ago but it’s still pending and I can’t set up any of my redirects until it’s finished, so I was just wondering if you think it’s necessary. Furthermore, is it possible that the previous XML sitemap error delayed the process?

    I know it’s not really an X question but I just wanted to get your opinion.

    Thanks again for all the great service.

    #1391529

    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in! Please make sure that every thing is okay before doing anything. This is to make sure that no further issues will be reflected in Google cache when it re index and cached your site again. Any previous error may have in conflict with the process. I am not sure though.

    If you need anything else we can help you with, don’t hesitate to open another thread.