<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: omer pakdil</title>
    <description>The latest articles on DEV Community by omer pakdil (@omerpakdil).</description>
    <link>https://dev.to/omerpakdil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1253817%2F9527869e-d7ae-4f82-af76-98daccaacb67.jpeg</url>
      <title>DEV Community: omer pakdil</title>
      <link>https://dev.to/omerpakdil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/omerpakdil"/>
    <language>en</language>
    <item>
      <title>I built a tool to fix broken link previews because localhost testing was a nightmare</title>
      <dc:creator>omer pakdil</dc:creator>
      <pubDate>Sun, 28 Dec 2025 15:07:58 +0000</pubDate>
      <link>https://dev.to/omerpakdil/i-built-a-tool-to-fix-broken-link-previews-because-localhost-testing-was-a-nightmare-3bjg</link>
      <guid>https://dev.to/omerpakdil/i-built-a-tool-to-fix-broken-link-previews-because-localhost-testing-was-a-nightmare-3bjg</guid>
      <description>&lt;p&gt;We've all been there.&lt;/p&gt;

&lt;p&gt;You spend weeks building a beautiful website. You deploy it on Vercel. You eagerly copy the link and paste it into your team's Slack channel or your family WhatsApp group to show it off.&lt;/p&gt;

&lt;p&gt;And then... &lt;strong&gt;nothing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Just a plain, ugly blue link. No image. No title. Maybe a random icon from your footer.&lt;/p&gt;

&lt;p&gt;It looks broken. It feels unprofessional. And honestly, it hurts a little bit inside.&lt;/p&gt;

&lt;p&gt;I spent way too much time debugging this recently. I realized that testing meta tags on &lt;code&gt;localhost:3000&lt;/code&gt; is impossible without tunneling tools like ngrok, and every platform (Twitter, WhatsApp, iMessage) has completely different, often undocumented, rules about image sizes and caching.&lt;/p&gt;

&lt;p&gt;So, I decided to fix it once and for all. I built a dedicated debugging tool, but first, I want to share the &lt;strong&gt;Ultimate Cheat Sheet&lt;/strong&gt; I wish I had when I started.&lt;/p&gt;

&lt;p&gt;Here is exactly what you need to put in your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; to make your links look premium on every platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Must-Have" Tags (Copy-Paste This)
&lt;/h2&gt;

&lt;p&gt;If you ignore everything else, just add these 4 lines. This covers 90% of use cases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- 1. The Title (Keep it under 60 chars) --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:title"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"My Awesome Project"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- 2. The Pitch (1-2 sentences) --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"This is the coolest thing I've ever built."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- 3. The Image (CRITICAL!) --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:image"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"https://mysite.com/og-image.png"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- 4. The Canonical URL --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:url"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"https://mysite.com/"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why these matter:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;og:title&lt;/code&gt;&lt;/strong&gt;: This is your headline. If it's too long, it gets cut off. Keep it punchy.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;og:description&lt;/code&gt;&lt;/strong&gt;: Your elevator pitch. Don't stuff keywords here; write for humans.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;og:image&lt;/code&gt;&lt;/strong&gt;: The single most important factor for Click-Through Rate (CTR). A link with a big image gets clicked. A link without one gets ignored.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The "Gotchas" That Wasted My Time
&lt;/h2&gt;

&lt;p&gt;Even with those tags, things still broke for me. Here is why detailed platform rules matter:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. WhatsApp is Picky
&lt;/h3&gt;

&lt;p&gt;WhatsApp is the worst offender. Many developers add a standard 1200x630px image and wonder why it doesn't show up.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;The Problem:&lt;/strong&gt; WhatsApp has a strict file size limit. If your image is &amp;gt; 300KB, it often just fails silently.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Fix:&lt;/strong&gt; You must compress your OG image heavily or provide a smaller, square fallback specifically for mobile apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. iMessage Loves Icons
&lt;/h3&gt;

&lt;p&gt;I was sending links via iMessage, and it kept ignoring my beautiful big banner.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;The Problem:&lt;/strong&gt; Unlike Facebook or Twitter, iMessage historically prioritizes the &lt;code&gt;apple-touch-icon&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Fix:&lt;/strong&gt; Always add a high-res icon in your head.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"apple-touch-icon"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/apple-touch-icon.png"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Twitter (X) Needs Extra Love
&lt;/h3&gt;

&lt;p&gt;Twitter &lt;em&gt;can&lt;/em&gt; use OG tags, but if you rely on the defaults, you get a tiny thumbnail on the left side of the tweet. It looks weak.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;The Fix:&lt;/strong&gt; Explicitly tell Twitter you want the "big card":
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"twitter:card"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"summary_large_image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"twitter:creator"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"@yourhandle"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. LinkedIn Caching
&lt;/h3&gt;

&lt;p&gt;LinkedIn caches your link preview data aggressively—sometimes for up to 7 days.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;The Nightmare:&lt;/strong&gt; You deploy a fix for a typo in your title, but LinkedIn still shows the old one.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Fix:&lt;/strong&gt; You have to manually force a re-scrape using their "Post Inspector" tool, or change the OG image URL (e.g., add &lt;code&gt;?v=2&lt;/code&gt;) to trick the cache.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How I Solved It (The Lazy Way)
&lt;/h2&gt;

&lt;p&gt;Debugging this manually is painful. You have to deploy to production, paste the link in a private Slack channel, see if it works, fix code, redeploy, repeat.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;&lt;a href="https://katsau.com" rel="noopener noreferrer"&gt;Katsau&lt;/a&gt;&lt;/strong&gt; to solve this loop.&lt;/p&gt;

&lt;p&gt;It's a suite of free debugging tools that emulate specific crawlers. Instead of a generic "preview", I built specific validators:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;a href="https://katsau.com/tools/whatsapp-link-preview" rel="noopener noreferrer"&gt;WhatsApp Previewer&lt;/a&gt;:&lt;/strong&gt; Checks that sneaky 300KB limit for you.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;a href="https://katsau.com/tools/twitter-card-validator" rel="noopener noreferrer"&gt;Twitter Card Validator&lt;/a&gt;:&lt;/strong&gt; Shows you exactly how the Summary Card renders.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;a href="https://katsau.com/tools/facebook-debugger" rel="noopener noreferrer"&gt;Facebok Debugger&lt;/a&gt;:&lt;/strong&gt; Simulates the standard OG scraper.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's completely free to use for debugging. (I also built an API for developers who need to generate previews in their own apps, but the debug tools are open to everyone).&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Don't let a fast deployment ruin your first impression.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Add the 4 essential tags.&lt;/li&gt;
&lt;li&gt; Compress your images (seriously, check the file size).&lt;/li&gt;
&lt;li&gt; Add the &lt;code&gt;summary_large_image&lt;/code&gt; tag for Twitter.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you found this helpful or if you try the tool, let me know what you think! I'm actively adding support for more platforms (Telegram is next on the roadmap).&lt;/p&gt;

&lt;p&gt;Happy coding! &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>seo</category>
      <category>beginners</category>
      <category>showcase</category>
    </item>
  </channel>
</rss>
