1 single blank line on post sitemap xml file

#450305
  • Resolved Aurora G.S.
    Rank Math free

    Hi,

    This is my sitemap post.

    https://digitalhack.ro/post-sitemap.xml

    I try all methods from your website. I add to the function.php file that snips code. I try a clean install it. I try everything … no luck to take out the first line empty. Gave me an error in google console because of that.

    No white space on files before PHP.. all stuff I try before come to you.

    Any advice?

    Best regards
    Aurora

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

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Did you have any multilingual plugins like WPML installed earlier?

    Please try inserting the following code at the end of the theme’s functions.php file to solve this problem:

    add_filter('rank_math/sitemap/entry', function ($url){
        if (isset($url['loc']) && empty($url['loc'])) {
            return false;
        }    return $url;
    });

    You may follow the URL below to find out how to properly insert filters and hooks into your website:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

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

    Thank you.

    ​​​​​​​

    Sorry. Already done this before coming to you. As I told you I did try all stuff.

    “No white space on files before PHP.. all stuff I try before come to you.”

    Nothing

    P.S. Plus not to mention is not a good practice to add in functions theme something. When the theme (no matter if is a child theme) is updated I lose… the customs code … so… yah. you should see how to fix it from your end… what makes this error come up. you are the one who creates the plugin.

    Anas
    Rank Math business

    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/

    We really look forward to helping 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 3 replies - 1 through 3 (of 3 total)

The ticket ‘1 single blank line on post sitemap xml file’ is closed to new replies.