CDN Support

#44241
  • Resolved WP Event Manager
    Rank Math pro
    Content AI Starter

    Dear Team,

    Just we have tried to check SEO and it show following warning (CDN resources not fully loaded).

    We have already CDN enabled and we are using from Kinsta hosting.

    http://prnt.sc/s1cw3p

    • This topic was modified 4 years, 7 months ago by Alberto.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Alberto
    Rank Math business

    Hi Ashok,

    Thanks for getting in touch with us.

    Please use this filter in your themeā€™s functions.php file to include your CDN URLs in the sitemap:

    /**
     * Filter to Add CDN Image URLs in the Sitemap
     *
     * @param string $src  Image URL.
     * @param object $post Post object.
     */
    add_filter( 'rank_math/sitemap/xml_img_src', function( $src, $post ){
        $src = str_replace( 'http://domain.com', 'https://cdn.domain.com', $src );
        return $src;
    }, 10, 2);

    Do change the domain to your actual domain name.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    WP Event Manager
    Rank Math pro
    Content AI Starter

    For including images in the sitemap, i have to enable this option or it is not necessary ?

    http://prnt.sc/s1eal3

    WP Event Manager
    Rank Math pro
    Content AI Starter

    I am using kinsta cdn and they provide total different url than as you have suggeted like cdn.techjobsfair.com so which one i have to use..

    please have look the following url.

    http://prnt.sc/s1eedk

    Alberto
    Rank Math business

    Hello,

    That option is for attachment URLs (so it means, the pages generated by WordPress for each image and not the images themselves).

    If you need those pages indexed you need to enable that option. In any other situation, you don’t really need that option enabled.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Alberto
    Rank Math business

    Hello,

    About the question “I have to also set property in the google console for indexing cdn images or just adding your code enough ?“, it is optional and about Kinsta and their CDN, as the screenshot you shared said, it is optional and it is to get extra data about the CDN, it doesn’t affect Rank Math nor Google ranks.

    About the code, it is almost fine, it should be like the one I added to sensitive data.

    • This reply was modified 4 years, 7 months ago by Alberto.
    WP Event Manager
    Rank Math pro
    Content AI Starter

    Ok one more question.

    when we use CDN for images path then we have to deal with canonical header and other settings or Rank Math plugin will do all the things ?

    Like Robot.txt file change, add link with rel=”canonical” in header etc..

    For example : https://cdnify.com/blog/improve-seo-with-cdn/

    Todd
    Rank Math free

    Hi Ashok,

    Your posts/pages don’t need any changes because the canonical tag is automatically added by Rank Math.

    Image files don’t need a canonical tag because that is needed only on HTML/PHP pages (like WP posts/pages/categories/tags etc.).

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this ticket.