I found this url:
https://gist.github.com/chriswiggins/0756f61f745b9b08cc13e86573768f05
And the following function from the Divi theme:
/* Add Divi images to Yoast sitemap, since Yoast doesn’t read Divi’s Page
* Builder code (https://github.com/Yoast/wordpress-seo/issues/4808) */
function dm_filter_wpseo_sitemap_urlimages($images, $post_id)
{
$post = get_post($post_id);
if (is_object($post)) {
$content = $post->post_content;
# Parse Divi Image modules
preg_match_all(‘/\[et_pb_image [^]]*]/’, $content, $divi_images);
foreach ($divi_images[0] as $divi_image)
{
# Add the image to the sitemap
preg_match(‘/src=”([^”]*)”/’, $divi_image, $src);
preg_match(‘/title_text=”([^”]*)”/’, $divi_image, $title);
preg_match(‘/alt=”([^”]*)”/’, $divi_image, $alt);
$images[] = array(‘src’ => $src[1], ‘title’ => $title[1], ‘alt’ => $alt[1]);
}
# Parse Divi Blurb modules
preg_match_all(‘/\[et_pb_blurb [^]]*]/’, $content, $divi_blurbs);
foreach ($divi_blurbs[0] as $divi_blurb)
{
if (preg_match(‘/image=”([^”]*)”/’, $divi_blurb, $image))
{
# If the blurb has an image, add it to the sitemap
preg_match(‘/title=”([^”]*)”/’, $divi_blurb, $title);
preg_match(‘/alt=”([^”]*)”/’, $divi_blurb, $alt);
$images[] = array(‘src’ => $image[1], ‘title’ => $title[1], ‘alt’ => $alt[1]);
}
}
}
return $images;
}
add_filter(‘wpseo_sitemap_urlimages’, ‘dm_filter_wpseo_sitemap_urlimages’, 10, 2);