• Resolved Michel Schonhage

    (@jun-e-jay)


    Hi!

    None of the images on the website show up in the sitemap (https://stylin.nl/page-sitemap.xml) eventhough we’ve added the filter in functions.php (see below).

    Any idea where it goes wrong?

    The filter in functions.php

    function filter_wpseo_sitemap_urlimages( $images, $post_id ) {
    return $images;
    };
    add_filter( ‘wpseo_sitemap_urlimages’, ‘filter_wpseo_sitemap_urlimages’, 10, 2 );

    Hope you can help!

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support devnihil

    (@devnihil)

    Whereas the XML Sitemap should dynamically update after any modification to it, if the site or server is caching the sitemap this can cause it to not update right away. We also have additional information on this at the following link: https://kb.yoast.com/kb/sitemap-does-not-update/. If you are not seeing the sitemap as updated, we would recommend checking your caching settings and to ensure that the sitemap is being excluded from the cache.

    If you are still experiencing an issue with the sitemap not updating after checking your caching settings, you can also force a cache reset by temporarily disabling the sitemap feature, and then re-enabling. To do so please perform the following steps:

      ?In WordPress go to SEO>General>Features
      ?For ‘XML Sitemaps’ Toggle the switch to ‘Disabled.’
      ??Click ‘Save Changes.’
      ?Toggle the switch back to ‘Enabled.’
      ?Click ‘Save Changes.’

    ?We also have a guide on how to enable/disable XML Sitemaps here: https://kb.yoast.com/kb/enable-xml-sitemaps-in-the-wordpress-seo-plugin/

    Can you please try the aforementioned suggestions and letting us know whether it resolves your issue and you are able to successfully update the sitemap?

    Thread Starter Michel Schonhage

    (@jun-e-jay)

    Hi, thanks. I added the url’s to the “no-cache” rules of WP Rocket, disabled the sitemap function in Yoast, cleared all cache, enabled the sitemap function in Yoast, but still it doesn’t show any images on the pages, see https://stylin.nl/page-sitemap.xml

    Any other suggestions?

    Pcosta88

    (@pcosta88)

    Hi,

    We are not sure why the images are failing to appear. If clearing the caching is not working, it may be an issue with the code and/or how the theme is generating the images.

    Can you confirm the custom code you created is correct? This guide explains more about the filter https://yoast.com/help/images-in-the-xml-sitemap/#image-filter2.

    Thread Starter Michel Schonhage

    (@jun-e-jay)

    Hi, please see above the code I used in functions.php. I have no idea why it is not working. How can we figure this out, so they show up? Any piece of code I can show so you can see if that is the correct code?

    Sa?a

    (@stodorovic)

    This code is just example and returns same array (it means that doesn’t add images into the sitemap).

    Which editor you use to create these pages? It seems that images are part of “a gallery”, but I’m not sure. Please elaborate more details how you have created these pages.

    Plugin Support amboutwe

    (@amboutwe)

    This thread has been marked as resolved due to a lack of activity.

    You’re always welcome to re-open this topic. Please read this post before opening a new request.

    Thanks for understanding!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Images not showing up in sitemap’ is closed to new replies.