Support » Plugin: Rank Math SEO – Best SEO Plugin For WordPress To Increase Your SEO Traffic » Google Search Console finds wordpress.com CDN paths are false in Sitemap

  • Resolved altugdesign

    (@altugdesign)


    Hello,

    I am using wordpress.com Jetpack CDN (AKA Photon) When RankMath creates my sitemap, so all my images are called like: //i3.wp.com/mydomainname.com/…

    While there are hundreds of images in my sitemap which are listed as “<image:loc>https://mydomainname.com/wp-content/uploads/…&#8221; RankMath only uses 4 of these images as “<image:loc>//i3.wp.com/mydomainname.com/wp-content/uploads/” and these 4 are shown as errors in Google Search Console

    What can I do to fix this?

    Thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Rank Math

    (@rankmath)

    Hello @altugdesign,

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    Please change the CDN settings of Sitemap in the plugin:
    https://rankmath.com/kb/filters-hooks-api-developer/#sitemap-cdn-urls

    Hope that helps.

    Thread Starter altugdesign

    (@altugdesign)

    Hello again. I tryed but it’s not helping.

    My line is:

    add_filter( 'rank_math/sitemap/xml_img_src', function( $src, $post ){
    	$src = str_replace( '//i0.wp.com/marinalar.com', 'https://marinalar.com', $src );
    
    	return $src;
    }, 10, 2);

    but still see i0

    also tryed for other subdomains of this cdn as i1, i2, i3 .. still no effect on my sitemap.

    I found out that I have to close “show images on sitemap” save and reopen and save again.. but no.. its not helping πŸ™ Any other advices?

    [ Please do not bump. ]

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @altugdesign

    The code you added is wrong. The CDN link should be 2nd parameter

    add_filter( 'rank_math/sitemap/xml_img_src', function( $src, $post ){
    	$src = str_replace( 'https://marinalar.com', '//i0.wp.com/marinalar.com', $src );
    
    	return $src;
    }, 10, 2);

    After adding the code, you will have to clear the cache. You can do so by updating the Sitemap & Permalink settings.

    Or you can also use the following filter to disable the Sitemap cache:
    https://rankmath.com/kb/filters-hooks-api-developer/#enable-disable-sitemap-cache

    Hope that helps. Thank you.

    Thread Starter altugdesign

    (@altugdesign)

    No, I guess you misread what I tryed to say. I want to ge rid of the i0.wp.com type linkings.

    It’s been a long time since I asked for help and I turned off the images from the sitemaps.

    Thanks anyway

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @altugdesign

    Sorry for the confusion.

    We thought you want to add CDN images in the Sitemap.

    To get rid of i0.wp.com images, you can use the following filter: https://rankmath.com/kb/filters-hooks-api-developer/#remove-change-images

    Code:

    add_filter( 'rank_math/sitemap/urlimages', function( $images, $post_id ){
    	foreach ( $images as $index => $image ) {
    		if ( false !== strpos( $image['src'], 'i0.wp.com' ) ) {
    			unset( $images[ $index ] );
    		}
    	}
    
    	return $images;
    }, 10, 2);

    Hope that helps. Thank you.

    P.S. Sorry for the delayed responses previously.

    Thread Starter altugdesign

    (@altugdesign)

    I don’t know why this is marked as “Resolved”

    It is not working.

    1- Added the code to my functions.php
    2- From the /wp-admin/admin.php?page=rank-math-options-sitemap -> I closed + saved + reopened sitemap images button + saved
    3- ctrl + f5 my posts sitemap source

    still no effect.

    I give up. But it is not resolved.

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @altugdesign

    This filter runs just before the images are added to the Sitemap and we had also checked it on our setup.

    Assuming you are using the latest version of all the plugins, themes, and WordPress (please update if not yet), it would seem like a conflict with one of the plugins or the theme you are using.

    To determine that, please follow this troubleshooting guide:
    https://rankmath.com/kb/check-plugin-conflicts/

    Only the site admin would know and your users won’t be affected by this troubleshooting.

    You can follow this video tutorial as well:

    Looking forward to helping you. Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.