• Resolved juliaus

    (@juliaus)


    Good afternoon.
    The sitemap is created by the Yoast SEO plugin. Pages and posts are displayed on the sitemap – the plugin generates two site maps.
    https://ksm-clinic.com.ua/sitemap_index.xml
    Until recently, everything worked correctly.
    Now the sitemap from posts is not displayed correctly, it gives an error. The file does not have the required xml-header; it is displayed as a html-page.
    What could lead to this result is unknown. No new plugins or updates were installed.
    The following actions were performed:
    1. Cleared cache.
    2. Clicked Settings>Permalinks ‘Save Changes’ without making any modifications.
    3. Deactivated and even re-installed YoastSEO.
    A positive result has not been achieved.
    When creating a new record, the post-sitemap.hml map update time changes, but the file itself continues to work incorrectly.
    Please tell me what could be the reason

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Saša

    (@stodorovic)

    It seems that some shortcodes from the sitemaps send HTML directly to output. It breaks sitemaps and I see fatal error. Which page builder you use for creation of the posts?

    You can try to “disable parsing images” with following PHP code:

    add_filter( 'wpseo_sitemap_content_before_parse_html_images', '__return_empty_string', 9 );
    

    If it works then we will try to find root of cause.

    Thread Starter juliaus

    (@juliaus)

    Elementor.
    Where do I need to paste this code? In which file?

    Saša

    (@stodorovic)

    You can add it into functions.php. Anyway, it’s testing purpose because it removes all images from post/page sitemaps. Other PHP snippet (which disable image parser) is:

    add_filter( 'wpseo_xml_sitemap_include_images', '__return_false' );
    
    Saša

    (@stodorovic)

    I think that Elementor isn’t root of cause (maybe together with some plugins).
    It’ll be helpful if you can find PHP error.log. If you can’t find it on CPanel then please ask your host where it’s located. Did you receive emails with errors when you tried to open post sitemap?

    Thread Starter juliaus

    (@juliaus)

    In error log there is nothing related sitemap. No emails received.
    Your second code solved the promblem. Thank you!
    P.S. Is it permanent or temporary solution?

    Saša

    (@stodorovic)

    The code from previous comments disable “image parser”. You can see that sitemaps don’t contain images. I think that you can left them until you find root of cause. I didn’t notice similar reports related to Elementor, but it’s possible that some 3rd plugin runs shortcodes to obtain images for sitemaps. It’s possible that you have used new shortcodes into latest posts.

    It’s weird because you don’t have any evidence about fatal errors because I saw them when I tried to open post sitemap.

    You should decide is it permanent or temporary solution. If you need images into sitemaps then you should try to check plugin conflicts with “Health Check & Troubleshooting”. I’ll try to send more details if you decide to try it.

    Md Mazedul Islam Khan

    (@mazedulislamkhan)

    This thread has been marked as resolved due to a lack of activity. You’re always welcome to re-open this topic.

    Thanks for understanding!

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

The topic ‘Post-sitemap.xml issue’ is closed to new replies.