# Any Website

## Getting Started

## Create a connection

1. Sign in to [OpenGraph+](/)
2. Go to your website's **Meta Tags** page
3. Create a new connection and copy your connection URL

Your connection URL looks like `https://$OGPLUS_KEY.ogplus.net`.

## Add all Open Graph meta tags

Add the following to your page's `<head>` tag:

```html
<head>
  <!-- ... other meta tags ... -->
  <meta property="og:title" content="Page Title">
  <meta property="og:description" content="A brief description of this page">
  <meta property="og:url" content="https://mysite.com/about">
  <meta property="og:site_name" content="My Site">
  <meta property="og:type" content="website">
  <meta property="og:image" content="https://$OGPLUS_KEY.ogplus.net/about">
  <meta name="twitter:card" content="summary_large_image">
</head>
```

Replace `https://$OGPLUS_KEY.ogplus.net` with your actual connection URL. Replace `/about` with the path of each page.

### Tag reference

| Tag | Value |
|-----|-------|
| `og:title` | The title of the page as it should appear when shared |
| `og:description` | A brief summary of the page content |
| `og:url` | The canonical URL of the page |
| `og:site_name` | Your website or brand name |
| `og:type` | `website` for general pages, `article` for blog posts |
| `og:image` | Your OpenGraph+ connection URL + page path |
| `twitter:card` | Always `summary_large_image` for large preview cards |

## Dynamic websites

If your site uses a server-side language, use it to output all tags dynamically.

### PHP

```php
<meta property="og:title" content="<?= htmlspecialchars($title) ?>">
<meta property="og:description" content="<?= htmlspecialchars($description) ?>">
<meta property="og:url" content="<?= 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ?>">
<meta property="og:site_name" content="My Site">
<meta property="og:type" content="website">
<meta property="og:image" content="https://$OGPLUS_KEY.ogplus.net<?= $_SERVER['REQUEST_URI'] ?>">
<meta name="twitter:card" content="summary_large_image">
```

### Node.js / Express

```html
<meta property="og:title" content="<%= title %>">
<meta property="og:description" content="<%= description %>">
<meta property="og:url" content="<%= req.protocol + '://' + req.get('host') + req.originalUrl %>">
<meta property="og:site_name" content="My Site">
<meta property="og:type" content="website">
<meta property="og:image" content="https://$OGPLUS_KEY.ogplus.net<%= req.path %>">
<meta name="twitter:card" content="summary_large_image">
```

### Python / Flask

```html
<meta property="og:title" content="{{ title }}">
<meta property="og:description" content="{{ description }}">
<meta property="og:url" content="{{ request.url }}">
<meta property="og:site_name" content="My Site">
<meta property="og:type" content="website">
<meta property="og:image" content="https://$OGPLUS_KEY.ogplus.net{{ request.path }}">
<meta name="twitter:card" content="summary_large_image">
```

## Static websites

For static HTML files, hardcode all tags for each page:

```html
<!-- index.html -->
<meta property="og:title" content="My Site — Home">
<meta property="og:description" content="Welcome to My Site">
<meta property="og:url" content="https://mysite.com/">
<meta property="og:site_name" content="My Site">
<meta property="og:type" content="website">
<meta property="og:image" content="https://$OGPLUS_KEY.ogplus.net/">
<meta name="twitter:card" content="summary_large_image">

<!-- about.html -->
<meta property="og:title" content="About — My Site">
<meta property="og:description" content="Learn more about My Site">
<meta property="og:url" content="https://mysite.com/about">
<meta property="og:site_name" content="My Site">
<meta property="og:type" content="website">
<meta property="og:image" content="https://$OGPLUS_KEY.ogplus.net/about">
<meta name="twitter:card" content="summary_large_image">
```

## Verify

Open the preview tool in your OpenGraph+ dashboard and paste a URL from your site. View your page source and confirm all Open Graph meta tags are present with correct values.


## Customize

OpenGraph+ captures your page in a headless browser and renders it as an image. You control what gets captured using meta tags in your HTML and CSS in your stylesheets.

All of the rendering options below are standard HTML meta tags and CSS, so they work the same regardless of framework. The [HTML, CSS, & HTTP guide](/docs/html-css) covers each one in detail. This page is a quick-start summary.

## Meta tags

Add these to your page's `<head>` alongside your `og:image` tag. They're all optional.

```html
<head>
  <meta property="og:image" content="https://$OGPLUS_KEY.ogplus.net/about">
  <meta name="twitter:card" content="summary_large_image">

  <!-- Render at 800px wide instead of the default -->
  <meta property="og:plus:viewport:width" content="800">

  <!-- Only capture this element instead of the full page -->
  <meta property="og:plus:selector" content=".hero-section">

  <!-- Inject inline styles on the captured element -->
  <meta property="og:plus:style" content="padding: 60px; background: #0f172a; color: white;">
</head>
```

See the [Rendering](/docs/html-css/rendering) guide for what each meta tag does and how they interact.

## CSS styling

OpenGraph+ adds a `data-ogplus` attribute to your `<html>` element during capture. Use it in your stylesheets to hide navigation, adjust spacing, or restyle anything for the social card without affecting your actual site.

```css
html[data-ogplus] {
  nav { display: none; }
  footer { display: none; }
  .hero { padding: 60px; }
}
```

If you're using Tailwind, there's a plugin that gives you `ogplus:` variants like `ogplus:hidden` and `ogplus-twitter:bg-sky-500`. See [CSS Styling](/docs/html-css/data-attributes) for plain CSS examples and [Tailwind setup](/docs/html-css/data-attributes#tailwind-css).

## Templates

For fully custom social card layouts that pull content from your page, use `<template>` elements. These let you build a completely different layout for screenshots without touching your visible page.

```html
<template id="ogplus">
  <div style="padding: 48px; background: #0f172a; color: white; height: 100%;">
    <h1 style="font-size: 48px;">
      ${document.querySelector('h1')?.textContent}
    </h1>
  </div>
</template>
```

See the [Templates](/docs/html-css/templates) guide for expression syntax, platform-specific templates, and full examples.

## Testing locally

The [Preview Bookmarklet](/docs/html-css/bookmarklet) sets the `data-ogplus` attribute in your browser so you can see how your CSS and Tailwind variants look without deploying or waiting for a real crawler to hit your page.

## Full example

All meta tags together in one `<head>`:

```html
<head>
  <meta property="og:title" content="My Page">
  <meta property="og:description" content="A brief description">
  <meta property="og:image" content="https://$OGPLUS_KEY.ogplus.net/about">
  <meta name="twitter:card" content="summary_large_image">
  <meta property="og:plus:selector" content=".hero-section">
  <meta property="og:plus:style" content="padding: 60px; background-color: #0f172a; color: white;">
  <meta property="og:plus:viewport:width" content="800">
</head>
```


## Troubleshooting

## Meta tags not in page source

View your page source, not DevTools. Meta tags must be in the initial HTML response, not injected by JavaScript. Social crawlers only see server-rendered HTML.

## Wrong path in og:image URL

The path must match the actual page URL. If your page is at `yoursite.com/blog/my-post`, the og:image URL should be `https://$OGPLUS_KEY.ogplus.net/blog/my-post`.

For dynamic sites, ensure your server-side code outputs the correct path. Hardcoded paths are the most common source of mismatches.

## Wrong image showing

This is almost always a caching issue. Purge the cached image from the OpenGraph+ dashboard, then re-check with the preview tool.

## JavaScript-rendered content

OpenGraph+ renders your page with a browser, so JavaScript content is captured in the social card image. But the `og:image` meta tag itself must be in the initial HTML for social platforms to read it. Social crawlers do not execute JavaScript.

## Social platforms not updating

Social networks cache images aggressively. After purging from OpenGraph+, use each platform's debugger to force a refresh:

- **Facebook**: [Sharing Debugger](https://developers.facebook.com/tools/debug/)
- **Twitter/X**: [Card Validator](https://cards-dev.twitter.com/validator)
- **LinkedIn**: [Post Inspector](https://www.linkedin.com/post-inspector/)

## Purging cached images

1. Go to your OpenGraph+ dashboard
2. Navigate to the website's cache page
3. Enter the URL and purge

The next request from a social platform will trigger a fresh render.

## Testing

Use the preview tool in your OpenGraph+ dashboard to verify your setup before sharing URLs. This shows you exactly what social platforms will see.

## Need a specific framework guide?

Check our framework-specific guides for detailed integration instructions for [Next.js](/docs/nextjs), [Nuxt](/docs/nuxt), [Astro](/docs/astro), [Django](/docs/django), [Laravel](/docs/laravel), [Jekyll](/docs/jekyll), [Middleman](/docs/middleman), [WordPress](/docs/wordpress), [Shopify](/docs/shopify), [Webflow](/docs/webflow), [Wix](/docs/wix), [Rails](/docs/rails), or [Sitepress](/docs/sitepress).

