Support » Plugin: Yoast SEO » Switch XML Sitemap image URLs to CDN (nextgen images)

  • chillmen


    I use this code to change images link in my sitemap to cdn one:
    function wpseo_cdn_filter( $uri ) {
    return str_replace( '', '', $uri );
    add_filter( 'wpseo_xml_sitemap_img_src', 'wpseo_cdn_filter' );

    It is working for post’s images but not for nextgen gallery images (inside pages).
    I still have instead of
    Does this code work only for post’s images?
    Any idea how to fix this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Chillman

    where do you add add the code


    You should add this code to functions.php file (inside your theme folder)
    Here is the link to yoast website, get more infos about this code:

    cheers dude

    I just noticed that my image urls in the sitemap were not pointing to my CDN. Thanks for your tip, I added the code and its fine now.

    Just curious, why is this not automated by Yoast’s plugin?

    Hi In webmaster tools if i want to add a sitemap the only option is to add it in the root eg but my sitemap exists on the root of as such I have no images indexed it webmaster tools under

    I have added but can not add a sitemap

    any ideas

    kind regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Switch XML Sitemap image URLs to CDN (nextgen images)’ is closed to new replies.