images not showing in sitemap – using prophoto theme

#22314
  • Resolved Brooke D
    Rank Math free

    Hi,
    images from my pages ( posts are ok ) are not showing in my sitemap. I’m using pro photo theme, which has a page builder, so that is the issue, but how can I get around it using pro photo?
    Thanks!

Viewing 1 replies (of 1 total)
  • Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    You can fix this problem by using the following filter to add the page builder images to your sitemap. I can suggest that you reach out to the authors of the page builder so that they can help in customizing the PHP logic to grab the post images:

    /**
     * Filter images to be included for the post in XML sitemap.
     *
     * @param array $images  Array of image items.
     * @param int   $post_id ID of the post.
     */
    add_filter( 'rank_math/sitemap/urlimages', function( $images, $post_id ){
    	return $images;
    }, 10, 2);

    Looking forward to helping you. Thank you.

    ​​​​​​​

    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 1 replies (of 1 total)

The ticket ‘images not showing in sitemap – using prophoto theme’ is closed to new replies.