• Resolved danniee

    (@danniee)


    Hi,

    I’ve been looking for a way to change the sitemap url because this is absolutely essential to me for various security reasons. I know doing so won’t stop everyone who wants to find it, but probably the majority.

    Either way, I have tried to get help from you guys but it seems you are a bit reluctant to even point me in the right direction.

    Did some research and found out the url can be changed by doing edits in the class-sitemaps-router.php file. I did so and the url did indeed change. My question is, by doing that will the sitemap still ping the search engines correctly when edits are made? I assume if I just point to the right url in Google Search Console, Google won’t have any issues finding the sitemap?

    I hope you can help me with this because I’ve been trying to find a solution for months :/

Viewing 2 replies - 16 through 17 (of 17 total)
  • Sa?a

    (@stodorovic)

    Yoast SEO creates sitemaps “on the fly” and it doesn’t store any XML static files. Some plugins can create static files when it’s possible to easier change path. Anyway, I don’t see any benefits because someone can easy get all your URLs from google index.

    There is the filter wpseo_sitemaps_base_url which you can use to add “prefix” for sitemap URLs or you can use the filter wpseo_sitemap_index_links (since 15.0) to modify links in sitemap index (more flexible).

    From other side, you need to add custom rewrite rules (I recommend .htaccess) or you can use WP filter rewrite_rules_array to modify WP rules (each change in the code requires to you click on Permalinks/Save Changes to flush rewrite rules). Also, you should prevent access with query string (eg in .htaccess) because someone can use ?sitemap= to get sitemaps.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Change sitemap url’ is closed to new replies.