Sitemap images from Gutenberg blocks are not listed

#230247
  • Resolved Ivo Ianchev
    Rank Math free

    Hello,

    For my Custom post types, I’m using Gutenberg block with ACF to display the content.

    For the sitemap I wish to include all images from the Gutenberg blocks. For this I saw that I must include the “Image custom fields” names in SITEMAP SETTINGS > (Custom post type).

    I have included the custom field names but still not seeing the images in the sitemap.
    Is there anything that I’m missing out?

    If you can help me, this will be great! Thanks!

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

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Could you please share your sitemap URL to check as well?

    For initial troubleshooting, please make sure that your sitemap is not cached. Please follow these steps:

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

    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:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    I hope that helps.

    Thank you.

    Hello,

    thanks for the response.

    I have cleared the Sitemap cache and Exclude the Sitemap files in our caching plugin as you had requested.

    Here it is the sitemap:
    https://als.global/sitemap_index.xml

    For example in https://als.global/our-services-sitemap.xml
    there is only one image (the thumbnail perhaps), and all other images made with custom Gutenberg blocks are not in the sitemap.

    Thanks!

    Ankit
    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,

    I have managed to include the images with a filter:

    function xmlsitemap_add_attached_images( $images, $post_id ) { 
        $attached_images = get_attached_media( 'image', $post_id);
        if($attached_images){
            foreach($attached_images as $attached_image){
                $image_arr = array();
                $image_arr['src'] = $attached_image->guid;
                $images[] = $image_arr;
            }
        }
        array_unique($images);
        return $images; 
    }; 
    
    add_filter( 'rank_math/sitemap/urlimages', 'xmlsitemap_add_attached_images', 10, 2 );
    

    Best regards!

    Hello,

    Thank you for sharing the filter and we are glad it worked for you.

    We are super happy that this issue is already resolved. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind us asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Sitemap images from Gutenberg blocks are not listed’ is closed to new replies.