Sitemap image doesnt appear

#1105286
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    We apologize for the issue you are facing with the images not appearing in your sitemap. It seems that the images from your gallery page are not being recognized by Rank Math for inclusion in the sitemap.

    To ensure that images are included in your sitemap, you can follow these steps:

    1. Check Image Settings: Make sure that the images you want to include are properly set up in the Advanced Gallery plugin settings. Sometimes, specific settings may prevent images from being recognized.

    2. Custom Code: If you have added custom code to your functions.php file, please ensure that it is correctly implemented. If you’re unsure about the code, you might want to share it here for us to review.

    3. Use the Correct Function: To include images in the custom sitemap, you can use the get_sitemap_links function as shown in our documentation. Here’s a basic example:

      public function get_sitemap_links( $type, $max_entries, $current_page ) {
         $links = [ 
             [
                 'loc' => 'https://rankmath.com/?sitemap=1',
                 'mod' => '2023-10-08',
                 'images' => [
                     [
                         'src'   => 'http://www.example.com/image1.png',
                         'title' => 'Image Title',
                     ],
                     // Add more images as needed
                 ],
             ],
         ];
         return $links;
      }

      Make sure to replace the URLs with your actual image URLs.

    4. Clear Cache: If you have caching enabled on your site, clear the cache after making changes to ensure that the sitemap reflects the latest updates.

    5. Check for Conflicts: Sometimes, other plugins can conflict with Rank Math. You can use the Health Check plugin to identify any potential conflicts.

    If you continue to experience issues, we recommend replying to this ticket with any additional details or code snippets you have used, and a human agent from our support team will assist you further.

    Thank you for raising this concern!

    Sources:
    How to Create a Custom Sitemap and Include It in Rank Math » Rank Math

    This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.

    Hello,

    Could you please confirm if you’re using any custom fields for your images? If so, please include the field’s name in Rank Math > Sitemap Settings > Page > Image Custom Fields:

    Once done, please try to follow the steps below and see if that works for you:

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

    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. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    3. Apply the following filter to your site to disable the transients cache for the sitemap.

    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
    

    Here’s how you can add a filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

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

    Thank you.

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

You must be logged in to reply to this ticket.