Search code examples
seorobots.txtlighthouse

robots.txt block all except lighthouse


I have a staging site, that I want to be able to test via google lighthouse - but do not want google to index it.

When I use this:

User-agent: *
Disallow: /

Lighthouse and google are blocked.

I think the user-agent is "Chrome-Lighthouse" for lighthouse (source), but I'm not sure how to write the syntax for robot.txt.

Any suggestions?


Solution

  • Thank you dbc the link gave me the answer

    useragent: *
    disallow= /
    
    useragent: Chrome-Lighthouse
    allow= /
    

    Based on the comment it should be:

    User-agent: *
    Disallow: /
    
    User-agent: Chrome-Lighthouse
    Allow: /