GitHub Pages with Cloudflare results in no Open Graph data

Hi,

I am hosting my static site with Github Pages using a custom domain (https://hideyoutubeshorts.xyz/), as far as I can tell everything is setup and propagated correctly and I am able to access the site just fine. However, none of my Open Graph meta data seems to work as intended. Sharing the URL to Discord, Twitter, Facebook, etc… shows no OG meta data preview at all, almost like it doesn’t exist.

  • I have configured my DNS settings to point hideyoutubeshorts.xyz and www. to probablyraging.github.io

  • I have set my custom domain in my Github repo settings, and at the recommendation of Github support, sucessfully enabled Enforce HTTPS to allow Github to handle HTTPS certificates

  • I have tested with Facebook’s Sharing Debugger tool (Sharing Debugger - Meta for Developers) and that shows no meta data either

  • I have gone through all the Cloudflare settings and double checked to make sure nothing should cause conflict, admittedly I am unsure what half of these settings do. No redirects, no routing, no firewall, not bot stuff, no hot link. I have even gone as far as pausing Cloudflare on the domain.

  • I have used the “Purge Everything” button between changes, and waited some time for caching/propagation

I contacted Github support and they assured me that everything looked fine on that end of things and that I should trying getting advice here instead.

So yeah, any help would be greatly appreciated,
Thanks

1 Like

On the Facebook Debugger tool page there is a link to see what their scrapers saw when scraping the page, this is all that their scrapers are seeing? No idea what is causing this issue

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head></html>

When trying to make the request through the debugger API, I get this error response

"error_user_msg": "Object at URL \"https://hideyoutubeshorts.xyz/\" of type \"website\" is invalid because a required property \"og:title\" of type \"string\" was not provided.",

After trying AWS Route 53 to manage DNS records and still facing the same issue, I no longer think this is a Cloudflare issue.

I was able to successfully resolve OG meta data when cloning my repo and hosting the site from a temporary express.js server.

So I believe the issues lies with Github Pages and I have updated my ticket with their support team.

the problem you are facing might be due to cloudflare’ss caching mechanism which can cache your pages and serve them to visitors from their edge servers. This caching process may cause open graph metadata to be missing or outdated as the cached version of the page might not included the latest changes

Furthermore, if purging the entire cache did not resolve the issue, the furniture villa you can try disabling caching specifically for URLs that contain open graph metadata. you should be able to create a page rule that excludes the certain URLs or URL patterns for cached.