Add OG and Twitter cards

Open Graph and Twitter card tags control how links render in feeds, chats and some assistants. Set og:title, og:description, og:url, og:type and an absolute og:image, plus twitter:card and matching fields. Generate them per page and make og:url equal the canonical.

mediumIn codeimpact effort

Why this matters

Control the title, description and image every share shows.

Get the full breakdown

The extended brief explains when this works, when it does not, and the trade-offs. Join the waitlist and it unlocks for every tip when sign-in opens; MCP access is the paid part.

Join the waitlist

Before you start

  • Access to the head template
  • A social preview image per page or template

How to apply it

  1. Add the core Open Graph fields

    Emit og:title, og:description, og:url, og:type and og:image as absolute URLs. Remove duplicate tags from other plugins or components.

    Check: The rendered head contains exactly one of each og tag and og:url equals the canonical.

  2. Add Twitter card fields

    Add twitter:card=summary_large_image plus twitter:title, twitter:description and twitter:image. Keep values consistent with the Open Graph fields.

    Check: The head contains the twitter:card tag and an absolute twitter:image URL.

  3. Validate a preview General best practice

    Run a link preview debugger for one article, one product and the homepage. Check the image dimensions and that the crop keeps essential text visible.

    Check: The preview shows the intended title, description and image for all three URL types.

Get the prompt for your agent

A ready-to-paste prompt for your agent that implements this tip and verifies the result in your repo.

Join the waitlist

Source: seo-mcp playbook · curated entry · report an error

Framework notes

nextjs-app

Use `openGraph` and `twitter` keys in `metadata` or `generateMetadata`; Next.js emits the tags server-side and supports per-route images. Add `app/opengraph-image.tsx` (or a route-level `opengraph-image.tsx`) for per-route social images.

shopify

Add `og:title`, `og:description` and `og:image` in `theme.liquid` using `page_title` and `page_description`, and check the theme does not also print them in a snippet.

Official references

Let your agent apply this + 161 more tips.

Pre-order — $19