Search code examples
phpwordpressheaderheadgooglebot

Is there meta for Google's bot to ignore apple-app-site-association and assetlinks.json?


I watch my logs when someone hits any of my site's 404 pages and I've noticed I get several alerts for Google's bot in regards to:

/.well-known/apple-app-site-association
/apple-app-site-association
/.well-known/assetlinks.json

After several searches and references I was able to learn more about what they are from:

but if that site never intends to have an app is there a way in the head to tell Google Bot this? When I search for answers I've run across:

From Google:

However, none of my searches indicates how to build a file to inform Google that the client doesn't intend to have an app associated with the site or a way in the head to tell Google.

So far the only solution I've been able to conclude was use conditional in PHP to ignore the request like:

$apple_app = home_url() . '/apple-app-site-association';
if ($request != $apple_app) :
  // use the force
end if;

Solution

  • Google-bot will obey the robots.txt directives. Try adding these rules to your robots.txt:

    User-agent: *
    Disallow: /apple-app-site-association
    Disallow: /.well-known/
    
    # These are additional paths Google is known to search (optional)
    Disallow: /m/
    Disallow: /mobile/
    

    I had your exact problem with the seemingly strange 404 log entries. They've stopped now. I hope this helps.