#sitemaps for a site doesn’t work and google does not rank my blog posts
38 messages · Page 1 of 1 (latest)
Looks like this is the built sitemap, should there be more posts linked?
It's been a while since I dug deep into Google Search Console settings, does it give you any details on what pages it found and what the errors are?
Okay let me see
For now there must be 3 blog posts on the site. The problem is that they are not ranked.
Sorry it is in lithuanian
But it shows that the urls are unknown.
For example
The sitemap is readable but contains errors
And at the bottom: The sitemap must be displayed on the HTML page. Use a supported sitemap format instead.
Ah ha, maybe that's it! Is there a meta tag in your page's <head> similar to <link rel="sitemap" href="/sitemap-index.xml">?
Let me check it,
@astrojs/sitemap will build the sitemap but it doesn't add the head link automatically
This actually makes me wonder if the experimental middleware feature could be used to add that automatically though! Until now the integration just hasn't had any way to add that <head> tag
Google will probably expect to find the sitemap link on your homepage
in docs there were mentioned to add it
okay, so i should add this to my main index.astro?
or in components/BaseHead.astro?
I'd probably add it into <BaseHead> if that's used on every page, I tend to throw the sitemap link in the head of every page just in case
okay, I will try it.
commited the changes, waiting for site to build itself
It shows me the same error
But in page source tab i can see that meta tag
My only guess at that point is Google has a cached copy and the error will go away once they catch up to the latest HTML and sitemap files
I ran the sitemap file on your site through a couple sitemap validator tools and they all showed it as valid 🤔
The answer of "just give it a couple days and check again" is about as helpful as "unplug it and plug it back in", but nothing else jumps out at me here
Maybe someone else will notice something I missed?
Okay, let’s wait, thank you for helping me out. I think it would be logical to wait until Google reconfigures everything
Glad to help, hope that goes the trick!