-
Good morning, I have a problem with the sitemap. If I click here: “Your sitemap index can be found here: https://www.ilovesponsor.it/sitemap_index.xml” the sitemap does not appear but a page with this text: “No results. The page you requested was not found. Refine your search, or use the navigation bar above to find the post”. How can I view the sitemap?
-
Hello, we’re sorry to hear that you’re facing an issue with your sitemap. It seems like there might be a problem with how the sitemap is being generated or accessed on your site.
Here are a few steps you can take to troubleshoot this issue:
-
Check if the Sitemap is Accessible: You can use a tool like httpstatus.io to check if your sitemap URL is accessible. Enter your sitemap URL and check the status to identify any issues.
-
Check for Plugin Conflicts: Sometimes, other plugins can conflict with Rank Math. You can use the Health Check plugin to determine if there’s a conflict with another plugin or theme.
-
Rewrite Rules: If you are using an Apache or Nginx server, ensure that the correct rewrite rules are added to your
.htaccessor Nginx config file. For Apache, you can add the following code:# START of Rank Math Sitemap Rewrite Rules RewriteEngine On RewriteBase / RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L] RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L] RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L] # END of Rank Math Sitemap Rewrite RulesFor Nginx, you would add:
# START Nginx Rewrites for Rank Math Sitemaps rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last; rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; rewrite ^/([a-z]+)?-sitemap.xsl$ /index.php?xsl=$1 last; # END Nginx Rewrites for Rank Math Sitemaps -
Caching Issues: If your sitemap is being cached, you may need to exclude it from caching. You can refer to our tutorial on how to exclude Sitemaps from caching.
-
Static File Conflict: Ensure that there isn’t a static file named
sitemap_index.xmlin your server that could be conflicting with the dynamic sitemap generated by Rank Math.
If these steps do not resolve the issue, please reply to this ticket with your site URL so that a human agent from our support team can assist you further. Thank you for raising this concern!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Indexed, Not Submitted in Sitemap – Google Search Console » Rank Maththank you very much
for this sitemap https://www.ilovesponsor.it/sitemap_index.xml you can find https://www.ilovesponsor.it/azienda-sitemap.xml too
I would like to esclude https://www.ilovesponsor.it/aziende/
Azienda is a CPT that I made with code.Since Rank Math doesn’t provide me with a “AZIENDA Archives” option in the dashboard (that is a CPT), the quickest and most effective solution is to embed the code into MY theme.
I think I can do only with code, correct?Hello,
Yes, since it is your CPT’s archive URL/page, it is set to show as the first URL in the sitemap by default.
However, if you want to manually remove it from the sitemap, you can use this filter on your site:
add_filter( 'rank_math/sitemap/post_type_archive_link', function( $archive_url, $post_type ){ if($post_type == 'azienda') { //change to match the actual post type return false; } return $archive_url; }, 10, 2 );Here’s how you can add a filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/Once done, flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDpLooking forward to helping you.
in pro version can I remove CPT’s archive URL without using the code?
Hello,
Yes, Rank Math will continue to include all individual CPT URLs in your sitemap.
Currently, removing the CPT archive URL still requires using a filter, even in the PRO version. If you prefer not to use code, you can disable the archive option directly when registering your CPT in the code.
Don’t hesitate to get in touch with us if you have any other questions.
thankyou very much
Hello,
Glad that helped.
Please feel free to reach out to us again in case you need any other assistance.
We are here to help.
Thank you.
-
You must be logged in to reply to this ticket.