DEV Community

Ben Greenberg
Ben Greenberg

Posted on

Quick tip: your og:image should be 1200x630px

Quick tip about link previews:

Your og:image should be 1200x630px. Most sites get this wrong — either wrong dimensions, an SVG (which many platforms reject), or a relative URL instead of absolute.

Check yours:

curl -s https://yoursite.com | grep 'og:image'
Enter fullscreen mode Exit fullscreen mode

If you're building something that reads og:image from other sites, the LinkPreview API handles all the edge cases: https://rapidapi.com/ben-eI6jno4PU/api/linkpreview1

Top comments (3)

Collapse
 
peter profile image
Peter Kim Frank

Love these sorts of tidy / actionable tips. I think you’re right in that truly most sites get this wrong.

Collapse
 
bengreenberg profile image
Ben Greenberg

100% and I appreciate that! Trying out these small post formats here for the first time. Nice to see the positive reception. :)

Collapse
 
ben profile image
Ben Halpern

We recently fixed this in Forem, up from a 1000 px default width before.