• Resolved slr1979

    (@slr1979)


    I created a custom sitemap for my frontend vendors (EDD Frontend Submissions) as they use a custom implementation for their vendors rather than the standard WP user. The sitemap works fine and has for years.

    Today, I decided to modify my function to include the user avatar as a sitemap image. I can see the image URL when I download the sitemap but the image count remains as zero. Some of my avatars are hosted locally, and some are called from Gravatar

    I have enabled/disabled the sitemap, cleared my PC and site’s cache and excluded the sitemap from my caching plugin but nothing has changed.

    I have a feeling that this has something to do with the sitemap image parser and I am wondering if there is some filter I should be using before returning the URL to the sitemap.

    Please advise

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @slr1979,

    Thanks for using the Yoast SEO plugin. You may need to add images via a filter:?wpseo_sitemap_urlimages. This filter will then register images to appear on the sitemap. Please refer to our developer documentation

    Thread Starter slr1979

    (@slr1979)

    Hello @maybellyne

    Thank you for the reply but as these are custom users and not posts, the wpseo_sitemap_urlimages does not apply as the post id variable is not relevant.

    I am building a custom sitemap for these users using the https://developer.yoast.com/features/xml-sitemaps/api/#add-a-custom-post-type method and adding the image within the function linked in $wpseo_sitemaps->register_sitemap( 'download_artist', 'generate_fes_vendor_sitemap' );

    As I say the image is present in the XML but the count does not update.

    Please advise further

    Plugin Support Maybellyne

    (@maybellyne)

    I re-read your initial post:

    Some of my avatars are hosted locally, and some are called from Gravatar

    I know Gravatars are hosted remotely, so adding them to your author sitemap is a super custom implementation Yoast SEO can’t help with.

    Regarding those hosted locally, can you share some insights on how that’s done?

    Plugin Support Maybellyne

    (@maybellyne)

    This thread was marked resolved due to a lack of activity, but you’re always welcome to re-open the topic. Please read this post before opening a new request.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom sitemap image count is zero but image url in sitemap?’ is closed to new replies.