<?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/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>LoupeKit - notes: seo</title>
    <link>https://loupekit.com/blog/</link>
    <atom:link href="https://loupekit.com/blog/seo/rss.xml" rel="self" type="application/rss+xml" />
    <description>Notes on seo, from the blog that https://loupekit.com/blog/rss.xml carries in full.</description>
    <language>en</language>
    <lastBuildDate>Tue, 03 Nov 2026 00:00:00 GMT</lastBuildDate>
    <item>
      <title>Why the share card shows the wrong image</title>
      <link>https://loupekit.com/blog/open-graph-card-wrong/</link>
      <guid isPermaLink="true">https://loupekit.com/blog/open-graph-card-wrong/</guid>
      <pubDate>Tue, 03 Nov 2026 00:00:00 GMT</pubDate>
      <category>seo</category>
      <dc:creator>Ján Turský</dc:creator>
      <description>The page looks right in the browser and the card looks wrong in the chat. That is because they are two different readers: one runs your scripts and fetches fresh, the other reads the raw HTML once and remembers it. (seo, 5 min)</description>
      <content:encoded><![CDATA[<p><strong>The page looks right in the browser and the card looks wrong in the chat. That is because they are <strong>two different readers</strong>: one runs your scripts and fetches fresh, the other reads the raw HTML once and <strong>remembers it</strong>.</strong></p><p>When a link is pasted into a chat, a post or a message, the platform does not render the page. It sends its own crawler, which requests the URL, reads the <code class="font-mono text-[0.92em]">&lt;head&gt;</code> for a handful of meta tags, fetches the image they point at, and stores the result. The card everybody sees afterwards is built from that stored copy.</p><p><em>the tags a card is built from</em></p><pre><code>&lt;meta property=&quot;og:title&quot; content=&quot;Why the share card shows the wrong image&quot;&gt;
&lt;meta property=&quot;og:description&quot; content=&quot;A preview is built by a crawler…&quot;&gt;
&lt;meta property=&quot;og:image&quot; content=&quot;https://example.com/cards/share.png&quot;&gt;
&lt;meta property=&quot;og:url&quot; content=&quot;https://example.com/blog/share-card/&quot;&gt;
&lt;meta name=&quot;twitter:card&quot; content=&quot;summary_large_image&quot;&gt;</code></pre><p>Every wrong card is one of those reads going differently from what the author expected. There are five usual ways.</p><h2>The crawler did not run your JavaScript</h2><p>This is the commonest by a distance. A single-page app sets its title and its Open Graph tags from a router or a head manager, <strong>after</strong> the bundle has loaded. A browser sees them. The share crawlers generally do not execute scripts, so they see whatever the server sent - typically the tags of the app shell, identical on every route.</p><blockquote><p><strong>Every page shares as the home page</strong> is the signature of this bug. <mark class="bg-accent-light text-text">The served HTML and the rendered DOM are two different documents</mark>, and a card is built from the first one.</p></blockquote><p>The fix is to put the tags in the HTML the server returns: server rendering, static generation, or a small edge function that writes the right <code class="font-mono text-[0.92em]">&lt;head&gt;</code> per route. Injecting them faster on the client does not help, because the crawler is not waiting for the client at all.</p><h2>The URL is not one the crawler can use</h2><dl><dt>A relative og:image</dt><dd>The protocol expects an absolute URL. <code class="font-mono text-[0.92em]">/cards/share.png</code> resolves in a browser and is simply dropped by several consumers, which then show no image or pick one from the page body.</dd><dt>An og:url pointing elsewhere</dt><dd>Some platforms treat <code class="font-mono text-[0.92em]">og:url</code> as the canonical object and read the card from <strong>that</strong> address. A template that sets it to the site root makes every article share as the home page, even when the article's own tags are correct.</dd><dt>An image the crawler is refused</dt><dd>A bot-blocking firewall, hotlink protection, an authenticated asset host, or a <code class="font-mono text-[0.92em]">robots.txt</code> rule over the image path. Some crawlers honour <code class="font-mono text-[0.92em]">robots.txt</code> for the image as well as the page. The browser is let through; the crawler gets a 403 and the card has no picture.</dd><dt>An image behind redirects</dt><dd>An <code class="font-mono text-[0.92em]">http</code> address that redirects to <code class="font-mono text-[0.92em]">https</code>, then to a CDN. Each redirect is another request the crawler may or may not follow, and an image behind two of them is an image some platforms never reach.</dd></dl><h2>The image is outside what the platform accepts</h2><p>Each platform has its own limits, they change, and an image outside them is dropped <strong>without an error anywhere you would see it</strong>. What holds across the major ones:</p><ul><li><strong>1200 by 630 is the safe size.</strong> It is close to the 1.91:1 ratio the large card layouts use, and large enough not to be upscaled on a high-density screen.</li><li><strong>Too small falls back to a thumbnail layout.</strong> Below a platform's minimum the card shrinks to a small square beside the text, or drops the image entirely.</li><li><strong>There is a byte ceiling</strong>, in single-digit megabytes. An uncompressed PNG screenshot can be over it.</li><li><strong>SVG is not accepted</strong> by the major platforms. Use PNG, JPEG or WebP, and serve it with an image content type rather than a generic one.</li></ul><p>Without an <code class="font-mono text-[0.92em]">og:image</code> at all, most platforms show a title-only card or guess from an image in the page, and the guess is whatever came first in the markup - often a logo or a tracking pixel. <strong>Social card</strong> builds a 1200 by 630 image from the page's own title and host, with the tags that point a share at it.</p><h2>The card is cached, and you fixed it after the first share</h2><p>A crawler fetches a URL once and keeps the result. Correct the tags, deploy, paste the link again, and the old card comes back - because the platform did not fetch anything. It had an answer already.</p><dl><dt>Ask for a fresh read</dt><dd>Facebook's Sharing Debugger and LinkedIn's Post Inspector both refetch a URL on request. That is the reliable route where it exists.</dd><dt>Change the URL</dt><dd>The cache is keyed on the address. A query string on the shared link, or a new filename for the image, is a different object to every platform and gets a fresh fetch.</dd><dt>Wait</dt><dd>Where neither is available the stored card expires on the platform's own schedule. Nothing on your side shortens it.</dd></dl><blockquote><p><strong>Get the card right before the first share, not after.</strong> The first fetch is the one that sticks, and it happens the moment somebody pastes the link - often the author, testing.</p></blockquote><h2>Tags that are present but ambiguous</h2><ul><li><strong>Duplicates.</strong> A theme and an SEO plugin each write an <code class="font-mono text-[0.92em]">og:image</code>. Platforms disagree about which one wins, so the same page can share differently in two places.</li><li><strong><code class="font-mono text-[0.92em]">name</code> instead of <code class="font-mono text-[0.92em]">property</code>.</strong> Open Graph is specified with the <code class="font-mono text-[0.92em]">property</code> attribute. Many consumers accept either; none is obliged to.</li><li><strong>No <code class="font-mono text-[0.92em]">twitter:card</code>.</strong> X needs it to choose the large image layout. The title, description and image it can take from the Open Graph tags.</li><li><strong>Tags outside the <code class="font-mono text-[0.92em]">&lt;head&gt;</code>.</strong> A meta tag written into the body by a script or a CMS block is in the document and outside the place a crawler reads.</li></ul><h2>Seeing what the crawler saw</h2><p>The test that settles most of these is to request the page the way a crawler does and read the raw response, not the DOM:</p><p><em>the served tags, and whether the image is reachable</em></p><pre><code>curl -sL -A 'facebookexternalhit/1.1' https://example.com/blog/share-card/ \
  | grep -iE '&lt;meta[^&gt;]+(og:|twitter:)'

curl -sIL -A 'facebookexternalhit/1.1' https://example.com/cards/share.png
# want: a 200, an image/* content type, a sane content-length</code></pre><p>If the first command prints nothing, or prints the home page's tags, the tags are being added by script. If the second ends in a 403, the crawler is being refused the image even though your browser is not.</p><p>From the page itself: <strong>Head order</strong> reads the tags in the order the parser meets them and names the missing and the duplicated, and <strong>Page source</strong> shows the DOM after the scripts have run. The SEO tab's rendering view puts the two side by side - what arrived in the HTML against what JavaScript added - which is the comparison every one of these bugs comes down to.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
