how to add custom sitemap for images in rankmath

#291240
  • Resolved Sajid Shaikh
    Rank Math free

    Hi,
    My images are all in webp format and they are not being indexed in google, I have created a custom images sitemap. How should I include it in Rankmath?

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

    Thank you for contacting Rank Math today.

    You can use and edit the following filter to add external sitemaps to your Rank Math sitemap: https://rankmath.com/kb/filters-hooks-api-developer/#18-filter-to-add-external-sitemap-to-the-rank-math-sitemap

    ​​​​​​Hope this helps solve your issues.

    Don’t hesitate to get in touch if you have any other questions.

    Hi,
    I have added the code but its not reflecting on the site, new sitemap is not showing in the main index sitemap file.

    Prabhat
    Rank Math agency

    Hello,

    Could you confirm if you’ve added the code as it is i.e, without making any changes? If yes, then you need to modify the code as per your requirement to generate the required sitemap.

    Looking forward to hearing back from you.

    Thank you.

    Hi,
    I have added this code, please find below:

    <?php
    add_filter( ‘rank_math/sitemap/index’, function( $xml ) {
    $xml .= ‘
    <sitemap>
    <loc>https://urdushayarighar.com/images-sitemap.xml</loc&gt;
    <lastmod>2021-11-13T11:59:41+01:00</lastmod>
    </sitemap>’;
    return $xml;
    }, 11 );

    Hello,

    Thank you for your patience.

    I’ve checked the sitemap link you shared, and it seems that it is being generated by another plugin.

    Please ensure that you don’t have any physical/static sitemap file (images-sitemap.xml) in your website’s root directory as Rank Math generates sitemap dynamically.

    I hope that helps.

    Thank you.

    Hi,
    yes images-sitemap is manually custom generated and that is what I am asking about the issue, please read the thread above. This sitemap is not visible in rankmath sitemap.

    Hello,

    Could you please follow the steps below and see if the custom sitemap shows up?

    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/

    If the issue persists, 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 updated the sensitive data as requested. Can you please check further?

    Thank you.

    I have done all the steps above but still my custom sitemap file is not showing in rankmath sitemap index. kindly check.

    Hello,

    We corrected the code on your website and added it in the file rank-math.php however, your sitemap is being heavily cached and we would require that you go through this article to make sure that no cache is being applied on that file: https://rankmath.com/kb/exclude-sitemaps-from-caching/

    There seems to be caching from multiple sources on the sitemap so you might need to look into Cloudflare, LS Cache and the server settings.

    Don’t hesitate to get in touch if you have any other questions.

    Hi I have already excluded Sitemaps in LS cache, but still its showing 9 sitemaps.it should show 10 sitemaps

    Hello,

    If you check your sitemap here: https://urdushayarighar.com/?sitemap=1, you can see the Image sitemap is being included in your main sitemap.

    It seems like there is a server-side cache that is heavily caching your sitemap. Please flush the cache and exclude your sitemap from the server-side cache to fix the issue. You can get in touch with your host and ask them to exclude your sitemap URLs.

    Let us know how that goes. Looking forward to your update.

    Thanks.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘how to add custom sitemap for images in rankmath’ is closed to new replies.