sitemath

#917445
  • Resolved Eva Garcia
    Rank Math free

    tengo este error:
    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.
    Ya he revisado no hay espcios ni en header, ni en footer, ni en funtions, ni wp-config, he puesto el filtro en rankmath.php que me decia el chat automatico, he incluido la url de sitemap en exceciones de cache, he añadido el bot _google… en rastreadores de litespeed, he hecho de todo sigue saliendo ese error no soy capaz a que se quite de ningún modo.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thank you for contacting Rank Math support and we apologize for any trouble you are facing with your sitemap.

    The issue you are seeing is caused by an XML declaration error on your sitemap. This means that there is some extra content or whitespace before the XML declaration in your sitemap file. This can make your sitemap invalid and unreadable by search engines.

    The most common reason for this error is a whitespace in your theme code, such as a blank line or space in your wp-config.php file or your theme’s functions.php file. This can happen when you edit these files manually or use a plugin or theme that modifies them.

    To fix this error, you need to find and remove the whitespace from your theme code. You can follow this guide to troubleshoot and resolve this issue: https://rankmath.com/kb/fix-sitemap-issues/#xml-text-declaration

    If you are not comfortable editing your theme code, you can also contact your hosting provider and ask them to check your website files for you. They should be able to locate and remove the whitespace for you.

    Alternatively, if you have some technical skills, you can also use this script to automatically fix this error: https://wejn.org/stuff/wejnswpwhitespacefix.php.html

    Please let us know if this helps you fix the XML declaration error on your sitemap. If you have any questions or issues, please don’t hesitate to contact us again. We are always here to assist you.

    Thank you for choosing Rank Math for your SEO needs.

    ya use todo eso, puse filtro para quitar el hueco, revise todo el php, puse el liberar espacios, nada el plugin rompe, incluso probe a desactivar todos los plugins de uno en uno y seguir para versi alguno entraba en conflictos, nada no quita el error, revise todo lo de las guias y todo lo que me has dicho antes de contactar, incluso meti en mi funtions para que elimine esa linea una funcion donde le obligo a leiminar la primera linea y esta esta vacia y nada no borrar ese hueco, sino darme pasos de que genera ese sitemap y como obligarlo a quitar esacio en blanco, proque intente todo ya.

    Nada de esto funciona e incluso meti filtro en el codigo de rank math php para filtrar y quitar cache nada no funciona nada

    Y por cierto esa landing que me pase no vale es antiguo y tiene errores de codigo si lo vuelves a enviar que sea asi function ___wejns_wp_whitespace_fix($entrada) {
    /* ¿Tipo de contenido válido? */
    $permitido = false;

    /* ¿Se encontró el encabezado de tipo de contenido? */
    $encontrado = false;

    /* Alteramos la salida si (y solo si) el tipo de salida es texto o XML */
    foreach (headers_list() as $encabezado) {
    if (preg_match(“/^content-type:\\s+(text\\/|application\\/((xhtml|atom|rss)\\+xml|xml))/i”, $encabezado)) {
    $permitido = true;
    }

    if (preg_match(“/^content-type:\\s+/i”, $encabezado)) {
    $encontrado = true;
    }
    }

    /* Hacer el trabajo real */
    if ($permitido || !$encontrado) {
    return preg_replace(“/\\A\\s*/m”, “”, $entrada);
    } else {
    return $entrada;
    }
    }

    /* Iniciar el almacenamiento en búfer de salida mediante devolución de llamada personalizada */
    ob_start(“___wejns_wp_whitespace_fix”);

    Hello,

    Please note that this is not an issue only with the sitemap. If you check any other pages of your website, you’ll see the blank line:

    Because of this blank line, the sitemap is not able to work properly.

    However, if you want, you can edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section so that we can check the issue further for you.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    Looking forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘sitemath’ is closed to new replies.