Yoast Premium SEO not generating Image XML Sitemaps

[ad_1]

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]
1 Comment

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer