Search code examples
htmlfacebookfacebook-opengraphmeta-tags

Facebook Open Graph tags not being grabbed (Grav CMS)


Facebook is not picking up open graph meta tags and the debugger responds as if they're not in the source code at all.

Here's the relevant page source (with title and url anonymized)

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Page Title</title>
<meta property="og:title" content="Page Title" />
<meta property="og:url" content="http://page.url/page-name" />
<meta property="og:type" content="article" />

Solution

  • I found the problem. For posterity: Grav CMS sends a Content-Encoding: none header when GZIP is not enabled. Facebook doesn't like this header, it breaks it's libcurl. In the sharing debugger it doesn't report this, it instead says the tags are missing.

    The simplest solution of course is to turn on GZIP in Grav config.

    Side note: I thought Grav was going to be a quick solution for a family member, the simple interface coupled with it supposedly being developer friendly under the hood appealed to me. Turns out it's developer friendly in the sense that you will encounter problems that will require your developer experience to solve as a result of there being numerous documentation errors, missing basic features and bugs in the plugins required for basic functionality. Also note that Google is not your friend for solving Grav problems as there's surprisingly little community support compared to other popular CMS.

    Not saying this to trash Grav, there's a lot about it that's good, the above is just stuff I wish I'd known going in.