GitHub social preview image not showing or not updating

GitHub serves Open Graph tags for every public repository. Upload a Social preview image under the repo Settings, or GitHub falls back to a generated card with your avatar. After you change the image, refresh each app's cache because platforms keep the old card.

Last updated

linkpreview.app
Meta Tag checker
framer.com
og:title
og:image
x.comRefresh
Launch week: everything new
From yoursite.com
index.html<head>
+<meta property="og:image"
+ content="/og/launch.png">
Quick fix

  1. Open the repository Settings page and scroll to Social preview.

  2. Upload a PNG, JPG or GIF under 1 MB, ideally 1280 x 640 px.

  3. Check the repo URL with the meta tag checker and confirm og:image points at your upload.

  4. Refresh LinkedIn, X or Slack with their tools, or share with ?v=2.

Why the GitHub social preview is wrong or missing

  • No custom image is set. GitHub then shows a generated card with the owner avatar, repo name and basic stats.

  • The repository is private. Custom social previews only share from public repositories.

  • The image failed the size rules. GitHub wants PNG, JPG or GIF under 1 MB, at least 640 x 320 px.

  • The app cached an earlier card. GitHub updates og:image right away, but LinkedIn, X and Slack keep their own cache.

  • You shared a commit, PR or issue URL. Those pages use GitHub’s generated card, not the repository Social preview.

LinkPreview meta tag checker result for example.com, showing missing Open Graph images as empty placeholders in Google, X, and Slack previews.

How to fix it

  1. Open the repository on GitHub and go to Settings.

  2. Under Social preview, click Edit, then Upload an image.

  3. Use a PNG, JPG or GIF under 1 MB. GitHub recommends at least 640 x 320 px, and 1280 x 640 px for best display.

  4. Check the repository URL with the meta tag checker and confirm og:image points at repository-images.githubusercontent.com or opengraph.githubassets.com.

  5. Refresh each app’s cache before you share the link again.

GitHub Docs article on customizing a repository's social media preview, showing the Social Preview upload control and a 1280 by 640 pixel image.

Tags GitHub writes

  • og:title for the repository name

  • og:description from the About description

  • og:image for the Social preview or the generated card

  • twitter:card as summary_large_image

LinkPreview meta tag checker result for github.com/facebook/react, showing the React repository Open Graph image, title, and description in Google, X, and Slack previews.

GitHub writes these tags for you. You do not edit the HTML of github.com pages.

Image size rules

  • PNG, JPG or GIF under 1 MB

  • At least 640 x 320 px

  • 1280 x 640 px recommended

  • PNG transparency is supported; a solid background is safer across dark modes

Check the file with the OG image size checker.

How to force a refresh

GitHub has no share debugger of its own. After the Social preview is live on the repo page, use LinkedIn’s Post Inspector, Meta’s Sharing Debugger, or share with ?v=2 on X and chat apps. The refresh tool has the step for every app.

Sources

FAQ

How do I set a GitHub social preview image?

Open the repository Settings page, scroll to Social preview, click Edit and upload a PNG, JPG or GIF under 1 MB.

Why does my GitHub link still show the old image?

GitHub updates og:image immediately. LinkedIn, X and Slack cache the old card, so refresh those tools or share with ?v=2.

Does a pull request use my Social preview image?

No. Commit, pull request, issue and release pages use GitHub’s generated card. Only the main repository URL uses your custom Social preview.

Check your page, then refresh the preview

Paste your URL into the free checker to see the exact tags each app reads. Once the tags are right, use the refresh tool to clear the old preview.