Sitemap error

#516363
Viewing 14 replies - 1 through 14 (of 14 total)
  • Hello,

    Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.

    The error you are encountering on your sitemap page, because most likely there is a white spaces before the XML Sitemap’s source code.

    Please follow this troubleshooting guide to fix that issue:
    https://rankmath.com/kb/fix-sitemap-issues/#xml-text-declaration

    Once done, please try clearing your browser cache and check if the issue is resolved for you.

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    I get this from Google:

    This page contains the following errors:
    error on line 4 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.

    Thanks!

    Hi,

    I am not sure I understand. I get this when I enter https://www.keto-programs.com/sitemap_index.xml

    XML Parsing Error: XML or text declaration not at start of entity
    Location: https://www.keto-programs.com/sitemap_index.xml
    Line Number 4, Column 1:
    <?xml version=”1.0″ encoding=”UTF-8″?><?xml-stylesheet type=”text/xsl” href=”//www.keto-programs.com/main-sitemap.xsl”?>
    ^

    What error is this in the tutorial?

    Where is the sitemap file located on apache?

    Thanks again!

    Hello,

    Please follow the steps below:

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    3. If the above steps doesn’t seem to work, kindly apply the following filter code to your site.

    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
    

    Here’s how you can add filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    If the issue persists, then this might be occurring due to a blank line/space in your wp-config.php file or your theme’s functions.php file. Please find and remove the blank space/line from there in order to fix this issue.

    You can also get in touch with your web host for assistance checking your website files for you.

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Hi again,

    I have tried everything, I also have disabled all plugins except RankMath, and I still get the same error.

    From Search console, I get this: https://ibb.co/X2Q34fF

    I have stopped http://www.keto-programs.com/author/benjaone from being indexed and made a 301 redirect by creating an author.php in my child theme with some code to redirect it to the front page., and made changes to the category settings in Rankmath.

    Thanks!

    Ben

    This is my child theme’s function.php:

    <?php

    function my_et_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_script( ‘divi’, get_stylesheet_directory_uri() . ‘/js/scripts.js’, array( ‘jquery’, ‘divi-custom-script’ ), ‘0.1.1’, true );
    }
    add_action( ‘wp_enqueue_scripts’, ‘my_et_enqueue_styles’ );

    /* === Add your own functions below this line ===
    * ——————————————– */
    add_action(‘after_setup_theme’, ‘db_remove_et_viewport_meta’);
    add_action(‘wp_head’, ‘db_enable_pinch_zoom’);

    function db_remove_et_viewport_meta() {
    remove_action(‘wp_head’, ‘et_add_viewport_meta’);
    }

    function db_enable_pinch_zoom() {
    echo ‘<meta name=”viewport” content=”width=device-width, user-scalable=yes, initial-scale=1.0, minimum-scale=0.1 “>’;
    }

    ?>

    This is the author.php i created:

    <?php
    //Redirect author pages to the homepage
    header(“HTTP/1.1 301 Moved Permanently”);
    header(“Location: /”);
    die(); // avoid further PHP processing
    //That’s all folks

    Should I include HTML sitemaps or not?

    Thanks!

    The sitemap link takes me to my 404 page now, so I deleted the snippet created from the tutorial without luck

    I rolled all the not-caching-sitemap stuff I did back, but I still got a 404 from my sitemap link.

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    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,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Thank you very much, it is much appreciated. A login token from the plugin is added to the sensitive data section.

    Hello,

    I’ve followed the steps mentioned above and the issue is fixed now.

    Here’s a screenshot for your reference:

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    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 14 replies - 1 through 14 (of 14 total)

The ticket ‘Sitemap error’ is closed to new replies.