• Resolved phoenix13

    (@phoenix13)


    Hello,

    The xml sitemap does not display the correct number of images. Why and how to solve the problem?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter phoenix13

    (@phoenix13)

    Hi,

    It’s OK with this code :

    function wpseo_xmlsitemap_add_attached_images( $images, $post_id) { 
    	$attached_images = get_attached_media( 'image', $post_id);
    	if($attached_images){
    		foreach($attached_images as $attached_image){
    			$image_arr = array();
    		    $image_arr['src'] = str_replace( 'https://XXXXX.com', 'https://CDN_XXXXX.kinstacdn.com', $attached_image->guid );
    			$images[] = $image_arr;
    		}
    	}
    	array_unique($images);
        return $images;
    }; 
    
    add_filter( 'wpseo_sitemap_urlimages', 'wpseo_xmlsitemap_add_attached_images', 10, 2 );
    Thread Starter phoenix13

    (@phoenix13)

    Ouups… No. Image urls (not all, but some) do not appear to be valid (404) ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘xml sitemap does not display the correct number of images’ is closed to new replies.