Support » Plugin: Yoast SEO » Page-Sitemap.xml error – Google Search Console

  • Resolved rainirowell

    (@rainirowell)


    Hi! Hoping you can help with this…

    I keep getting an error in Google Search Console (Unsupported file format) for the page sitemap – the others work absolutely fine.

    I tried to test what was causing it by turning off all the plugins – which worked. I turned them on one by one but none of them re-triggered the error till it returned a day later. Not sure how to troubleshoot this.

    The error on the page sitemap:

    This page contains the following errors:
    error on line 215 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.
    body #gform_wrapper_1 .gform_footer input[type=submit] { border-style: solid; color:#ffffff ;background-color:#1a7f7f ;padding-left:10px ;padding-right:10px ;padding-top:10px ;padding-bottom:10px ; border-width: 0px; } body #gform_wrapper_1 .gform_page_footer input[type=submit], body #gform_wrapper_1 .gform_page_footer input[type=button] { border-style: solid; color:#ffffff ;background-color:#1a7f7f ;padding-left:10px ;padding-right:10px ;padding-top:10px ;padding-bottom:10px ; border-width: 0px; } body #gform_wrapper_1 .gform_page_footer input[type=submit]:hover { border-style: solid; background-color:#bb5724; color:#ffffff; } body #gform_wrapper_1 .gform_footer input[type=submit]:hover { border-style: solid; background-color:#bb5724; color:#ffffff; } body #gform_wrapper_1 .gform_footer button.mdc-button { color:#ffffff ;background-color:#1a7f7f ;padding-left:10px ;padding-right:10px ;padding-top:10px ;padding-bottom:10px ; border-width: 0px; } body #gform_wrapper_1 .gform_footer button.mdc-button:hover { background-color:#bb5724; color:#ffffff; } body #gform_wrapper_1 .gform_footer { } body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=text], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=email], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=tel], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=url], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=password] { background-color:#eae1da ;width:400px ;border-color:#eae1da ; max-width:100%; border-width: 1px; } body #gform_wrapper_1 div.ginput_complex.ginput_container.ginput_container_name, body #gform_wrapper_1 div.ginput_complex.ginput_container, body #gform_wrapper_1 li.gfield .ginput_container.ginput_container_list { width: 400px; max-width:100%; } body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container.ginput_container_name input[type=text], body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container.ginput_container_name select, body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container input[type=”text”], body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container input select, body #gform_wrapper_1 .gform_body .gform_fields li.gfield .ginput_container.ginput_container_list input[type=text] { max-width:100%; width:100% } body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_ampm select { width: calc( 3rem + 20px ); } body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_hour input, body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_minute input { width: calc( 3rem + 8px ); } body #gform_wrapper_1 .gform_body .gform_fields .gfield textarea { width:800px ; border-width: 1px; background:#eae1da; border-color:#eae1da; } body #gform_wrapper_1 .gform_body .gform_fields .gfield select { background-color:#eae1da ;border-color:#eae1da ; max-width: 100%; border-width: 1px; } body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_label { text-align:left ;color:#013438 ; } body #gform_wrapper_1 .gform_body .gform_fields .gsection { } body #gform_wrapper_1 .gform_body .gform_page_footer .gform_next_button { border-style: solid; background: #1a7f7f; color: #ffffff; } body #gform_wrapper_1 .gform_body .gform_page_footer .gform_next_button:hover { background: #bb5724; color: #ffffff; } body #gform_wrapper_1 .gform_body .gform_page_footer .gform_previous_button { background: #1a7f7f; color: #ffffff; } body #gform_wrapper_1 .gform_body .gform_page_footer .gform_previous_button:hover { background: #bb5724; color: #ffffff; } body #gform_wrapper_1 .gform_body .gform_page_footer .gform_button { background: #1a7f7f; color: #ffffff; } body #gform_wrapper_1 .gform_body .gform_page_footer .gform_button:hover { background:#bb5724; color:#ffffff; } /* Styling for Tablets */ @media only screen and ( max-width: 800px ) and ( min-width:481px ) { body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=text], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=email], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=tel], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=url], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=password] { width:400px ; } body #gform_wrapper_1 div.ginput_complex.ginput_container.ginput_container_name, body #gform_wrapper_1 div.ginput_complex.ginput_container, body #gform_wrapper_1 li.gfield .ginput_container.ginput_container_list { width: 400px; max-width:100%; } body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container.ginput_container_name input[type=text], body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container.ginput_container_name select, body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container input[type=”text”], body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container input select, body #gform_wrapper_1 .gform_body .gform_fields li.gfield .ginput_container.ginput_container_list input[type=text] { max-width:100%; width:100%; } body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_ampm select { width: calc( 3rem + 20px ); } body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_hour input, body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_minute input { width: calc( 3rem + 8px ); } body #gform_wrapper_1 .gform_body .gform_fields .gfield textarea { width:350px ; } } /* Styling for phones */ @media only screen and ( max-width: 480px ) { body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=text], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=email], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=tel], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=url], body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=password] { width:400px ; } body #gform_wrapper_1 div.ginput_complex.ginput_container.ginput_container_name, body #gform_wrapper_1 div.ginput_complex.ginput_container, body #gform_wrapper_1 li.gfield .ginput_container.ginput_container_list { width: 400px; max-width:100%; } body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container.ginput_container_name input[type=text], body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container.ginput_container_name select, body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container input[type=”text”], body #gform_wrapper_1 .gform_body .gform_fields div.ginput_complex.ginput_container input select, body #gform_wrapper_1 .gform_body .gform_fields li.gfield .ginput_container.ginput_container_list input[type=text] { max-width:100%; width:100% } body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_ampm select { width: calc( 3rem + 20px ); } body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_hour input, body #gform_wrapper_1.gform_wrapper .gform_body .gform_fields .gfield_time_minute input { width: calc( 3rem + 8px ); } body #gform_wrapper_1 .gform_body .gform_fields .gfield textarea { width:350px ; } } /*Option to add custom CSS */

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Carl B

    (@devnihil)

    @rainirowell If your sitemap is generating an error of ‘XML declaration allowed only at the start of the document’ we would recommend first reviewing the source code of the page to see whether the document contains any whitespace for the first line of the file.

    The error ‘XML declaration allowed only at the start of the document’ is typically caused when another file, plugin, or theme adds white space to the beginning of the sitemap file. You will need to view the source code of the document in order to confirm this, and we have additional information on this and how to resolve this error at the following link: https://kb.yoast.com/kb/xml-sitemap-error/.

    Also, the additional white space in the sitemap file can be caused by an empty line at the end of your theme’s functions.php file, or by having a blank line or space at the beginning of your wp-config.php file.

    In order to resolve this, we would first recommend clearing your site’s caching. If you are not sure how to clear your server caching, please speak with your host provider. Does clearing your caching from your caching plugin (W3TC, WP Supercache, etc), server (Varnish, LiteSpeed, or others), or CDN (such as Cloudflare, Amazon AWS, etc) resolve the issue? If after clearing your site’s cache you are still experiencing the error on the sitemap, we would then next recommend checking your theme’s functions.php file for an empty line at the end of the file, as well as your wp-config.php file for any additional spaces at the beginning of the file.

    If you cannot find any empty lines at the end of your theme’s functions.php file or blank lines or spaces at the start of the wp-config.php, we would next recommend running a conflict check to identify whether another plugin or them is outputting the additional white space in the sitemap file. The fastest way to do this is to deactivate all non-Yoast plugins and switch to a standard theme like Twenty Nineteen. Test this on your development or staging site, if you have one. If not, we recommend using the Health Check & Troubleshooting plugin which can be downloaded here: https://wordpress.org/plugins/health-check/. This plugin allows you to run a conflict check without affecting normal visitors to your site. If you are unfamiliar with checking for conflicts, you can find a step-by-step guide that will walk you through the process here: https://kb.yoast.com/kb/how-to-check-for-plugin-conflicts/

    • This reply was modified 5 months, 3 weeks ago by Carl B.
    Plugin Support Carl B

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.