• Resolved andi2021

    (@andi2021)


    Is there a way to modify the ‘sitemap_images($url)’ function in order to incorporate a custom field, such as ‘image:title,’ into the image sitemap? I have reviewed the documentation for RankMath but have not found any hooks or filters that allow for this specific customization. I would greatly appreciate any assistance you can provide. Thank you for your help.

Viewing 1 replies (of 1 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @andi2021,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    Unfortunately, we don’t have a filter code to include the image:title tag. You can modify the incoming image object of a post URL for your sitemap entry using the filter code below but it is unlikely that our sitemap will accept image:title when you insert it into the image object:
    add_filter( 'rank_math/sitemap/entry', function( $url, $type, $object ){ return $url; }, 10, 3 );

    You may refer to this guide on how to add the code to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

Viewing 1 replies (of 1 total)
  • The topic ‘Can I edit function sitemap_images($url)’ is closed to new replies.