How to recognize Facebook User-Agent
When sharing one of my pages on FB, I want to display something different. Problem is, I prefer not to use the og: elements, but to recognize FB user-agent. What is it? I can't find it. Martin. For list of user-agent strings, look up here . The most used, as of September 2015, are facebookexternalhit/* and Facebot . As you haven't stated what language you're trying to recognize the user-agent in, I can't tell you more information. If you do want to recognize Facebook bot in PHP, use if ( strpos($_SERVER["HTTP_USER_AGENT"], "facebookexternalhit/") !== false || strpos($_SERVER["HTTP_USER_AGENT"]