I own a photography site, and before using Elementor page builder (please don’t chastise me), all of my images would be indexed via Google due to, I assume, Guttenberg blocks.
Now it only indexes the feature image rather than all of the images from the post. All of these have optimized titles and alt text, so it would be beneficial for them to be indexed.
Can someone please help me get Yoast to recognize this XML sitemap for the images? All I can find is this code snippet, but no statement of where to place it.
function filter\_wpseo\_sitemap\_urlimages( $images, $post\_id ) { array\_push($images, \[‘src’ => ‘https://www.example.com/wp-content/uploads/extra-image.jpg’, ‘title’ => get\_the\_title( $post\_id )\]); return $images; }; add\_filter( ‘wpseo\_sitemap\_urlimages’, ‘filter\_wpseo\_sitemap\_urlimages’, 10, 2 );
It also seems this is just for one URL vs a sitemap that I submit to the search console
[ad_2]
place it in the end of funcitons.php