Changing the Domain inside sitemap.xml

#473385
  • Resolved Dan Antony
    Rank Math free

    Hello,

    We are proxy passing our website so our domain name that needs to be public is different than whats mentioned in our wordpress declarations.

    /**
    * Filter to change the Sitemap URL Base
    *
    * @param string $base New URL Base
    */
    add_filter( 'rank_math/sitemap/base_url', function( $base ){
    return '/search-sitemaps/';
    }, 10, 1 );

    I saw this in the filters and hooks section but How do I modify this to change the domain and path?

    example internally our declaration is blog.acme.com/blog

    We need this to be https://acme.com/blog as the sitemap prefix.

    i.e all sitemap.xml should be

    https://acme.com/blog/post1
    https://acme.com/blog/post2
    https://acme.com/blog/post3

    etc.

    I hope that is clear enough! thank you

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The ticket ‘Changing the Domain inside sitemap.xml’ is closed to new replies.