• Resolved Hamed Sedaghat

    (@visualhost)


    Hi Dear(s),

    How can I use Custom sitemap for Preload? or exclude a sitemap from preloading?

    in this case, I have sitemap by rankmath, and I need product sitemap because of SEO, so can not delete that sitemap

    and also I need product be cachable by first visit, so can not exclude from caching

    but about preload, I need to exclude product from (only) preloading, Because the number of products is very large and preloading takes a lot of time, so any product get first visit, then will cached

    What is done in practice is:

    I will clear part of cache via cron at midnight (00:01) for: homepage, shop, product, product categories and nothing else

    then I set preload for daily at 00:05 (by click save button at exactly that time), As a result preload start automaticly And I want everything to be preloaded except products.

    with best wishes

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support vupdraft

    (@vupdraft)

    Hi,

    Try using this for the sitemap

    // Add a filter to ensure the new sitemap filename is used

    add_filter( ‘wpo_cache_preload_sitemap_filename’, ‘set_custom_sitemap_filename’ );

    /**

     * Set a custom sitemap filename

     */

    function set_custom_sitemap_filename( $filename ) {

        return ‘sitemap-test.xml’;

    }

    For the products, I am afraid you cannot currently exclude just the products, you would need to exclude the whole page.

    Thread Starter Hamed Sedaghat

    (@visualhost)

    its great

    i will use custom sitemap and add RankMath sitemaps as I need inside custom sitemap

    the custom sitemap will contain this:

    https://domain.com/page-sitemap.xml

    https://domain.com/post-sitemap.xml

    https://domain.com/product_cat-sitemap.xml

    so only page, post and product cat will preloading, True?

    Thread Starter Hamed Sedaghat

    (@visualhost)

    Yes, It worked fine.

    We can put any sitemap we want inside this custom sitemap.

    The advantage of this is that when the main sitemap is updated automaticly by RankMath, the custom sitemap will also be updated based on the latest changes.

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

The topic ‘Custom Preload’ is closed to new replies.