Today I found an error that appeared in GSC recently.

The URL of the affected page is not a page actually.

That’s a API call that the JS is requesting to retrieve an active user.

When you go to that URL directly, it says:

{'type':-2,'msg':'You are not logged in'} 

Just a blank text on a white screen.

GSC is returning 2 issues for the page:

  1. Viewport not set
  2. Text too small to read

We did not have such an issue a few days ago!

How to fix this? Should we just decline robots?



API endpoints are usually not useful to have in Google Search Results, so the best thing to do would be to block them using robots.txt as you suggested.

These API endpoints are not supposed to be viewed directly by an end-user, so usability issues like 'viewpoint not set' and 'text too small to read' are nonsensical. I'm not sure how Google decided to try to index these API endpoints. There is no reason for Google to try to crawl them, so block them using robots.txt.

Someone else may suggest using a noindex HTTP header on these endpoints instead of using robots.txt, however that's not quite what we want. A noindex header tells Google 'this is a page that we don't want in the search index' whereas a robots.txt disallow tells Google 'there isn't any human-readable content at this URL so don't even try to parse it'. So robots.txt is a better choice in this situation.

Pracoval pro vás: Charles Robertson | Chcete nás kontaktovat?