#sitemaps for a site doesn’t work and google does not rank my blog posts

38 messages · Page 1 of 1 (latest)

wheat perch
#

My website mokslopolis.com I have added sitemaps extension followed the instruction. When I type URL for xml it displays it. But blog posts are still invisible to search engine. Google search console shows them as an error.

warped robin
#

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?

wheat perch
#

Okay let me see

wheat perch
#

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.

warped robin
#

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">?

wheat perch
#

Let me check it,

warped robin
#

@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

wheat perch
#

in BlogPost.astro :

#

I added that meta tag

#

but

#

it still doesnt work

warped robin
#

Google will probably expect to find the sitemap link on your homepage

wheat perch
#

in docs there were mentioned to add it

#

okay, so i should add this to my main index.astro?

#

or in components/BaseHead.astro?

warped robin
#

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

wheat perch
#

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

warped robin
#

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 🤔

warped robin
#

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?

wheat perch
#

Okay, let’s wait, thank you for helping me out. I think it would be logical to wait until Google reconfigures everything

warped robin
#

Glad to help, hope that goes the trick!

wheat perch
#

What if i have to add the sitemap to robots.txt file like this?

#

Maybe that is the problem.

wheat perch
#

Oh wait

#

Ive added it