Skip to contentSkip to main navigation Skip to footer

Add Custom Open Graph Metadata

Squirrly SEO Add Custom Open Graph Metadata screen on a laptop

Squirrly SEO lets you change the Open Graph tags of one page from the Open Graph tab of its SEO Snippet, and of many pages at once with the sq_open_graph filter. The global defaults are in Social Media Settings.

The Bulk SEO task text says these tags control “the way your post looks when people share this URL to Facebook, LinkedIN and other social networks”. The examples come from demo.squirrly.co with Squirrly SEO 14.2.9.

The tags Squirrly writes

The tags go in the page head as <meta property="og:...">. On the demo post “How to feed multiple cats with different diets”, they start like this:

<meta property="og:url" content="https://demo.squirrly.co/feeding-multiple-cats/" />
<meta property="og:title" content="How to feed multiple cats with different diets" />
<meta property="og:type" content="article" />
<meta property="og:image" content="https://demo.squirrly.co/storage/2026/10/feeding-multiple-cats.jpg" />
<meta property="og:site_name" content="Whisker Bowl Demo" />
<meta property="og:locale" content="en_US" />
TagWhere Squirrly takes it fromChange it in
og:urlThe URL of the pageThe sq_open_graph filter
og:titleThe Open Graph title, or the SEO title cut at Open Graph Title LengthOpen Graph tab
og:descriptionThe Open Graph description, or the meta description cut at Open Graph Description LengthOpen Graph tab
og:typeThe OG Type of the page, or the one of its post typeOG Type, or Automation
og:imageThe snippet image, the images of the post, then the default imageMedia Image
og:site_nameThe WordPress Site TitleSettings > General in WordPress
og:localeThe site language, or Facebook Share LanguageSocial Media Settings

Change the Open Graph of one page

  1. Open the page in the editor and scroll to the SEO Snippet box. You can also click the page’s dot in the Open Graph column of Squirrly > Optimize > Bulk SEO.
  2. Open the Open Graph tab and click Edit Open Graph.
  3. Click Upload under Media Image and pick an image at least 500 pixels wide.
  4. Write the Title and the Description, or leave them on the pattern.
  5. Add the author’s Facebook profile in Author Link. For several authors, separate the links with commas.
  6. Pick an OG Type, or keep (Auto) to use the type of the post type.
  7. Click Save, then Validate Snippet to open the page in the Facebook Sharing Debugger.
Squirrly SEO Bulk SEO list with METAs, Open Graph, Twitter Card and Visibility columns
The Open Graph column in Bulk SEO opens the same tab of the SEO Snippet.

The preview under the fields is titled “How this page appears on Social Media”. Bulk SEO lists the tasks behind the green and red dots, such as OG title not empty and OG Image.

Example on the demo store

The Open Graph tab shows the pattern each empty field falls back to. The page source shows the values that come out:

Squirrly SEO snippet Open Graph tab with Media Image, Title, Description, Author Link and OG Type
The Open Graph tab of a demo post, with the fields left on their patterns.
Squirrly SEO Open Graph and Twitter Card tags in the page source
The og: tags in the page source of the same post, lines 1 to 16 (formatted for reading).

Change the Open Graph with a filter

sq_open_graph passes the tags as an array, with the tag name as the key. Squirrly builds the array at priority 10 and turns it into meta tags at 99, so a filter at priority 11 sees every value and can change it.

add_filter( 'sq_open_graph', function ( $og ) {
    // Add a description of the image on every product page
    if ( is_singular( 'product' ) ) {
        $og['og:image:alt'] = get_the_title();
    }
    return $og;
}, 11 );

Put the code in the functions.php of a child theme or in a small plugin. Always return $og, because a filter that returns nothing removes all the Open Graph tags from the page.

ToDo this in the filter
Change a tag$og['og:title'] = 'New title';
Add a tag$og['og:image:alt'] = 'Text';
Add the same tag twiceGive it an array: $og['og:image'] = array( $url1, $url2 );
Remove a tagunset( $og['og:locale'] );

The same mechanism exists for JSON-LD, described in Add Custom JSON-LD Structured Data. Squirrly escapes every value and prints it as <meta property="key" content="value" />. The filter runs only while Open Graph Optimization is on in Squirrly > All Features.

Troubleshooting

“Image size must be at least 500 pixels wide”

The SEO Snippet shows this next to Media Image. Upload a wider image.

Facebook still shows the old title or image

Click Validate Snippet and fetch the page again in the Facebook Sharing Debugger.

“Post Type (…) was excluded from Squirrly > Automation”

Squirrly doesn’t load on the front end for that post type, so the tags aren’t printed. Add the post type back in Squirrly > Optimize > Automation.

Frequently asked questions

Does the Open Graph title replace my SEO title?

No, it changes only og:title, and the page title in Google stays the same.

Do other plugins’ Open Graph tags stay on the page?

No, while Open Graph Optimization is on Squirrly removes the other og: and article: tags.

Can I set the Open Graph of a category page?

Yes, the term editor of a category has the same SEO Snippet box.

Was This Article Helpful?

Before you leave

Future of AEO GEO and AI Search!

Free Now. Free Forever.

It’s time to stop orbiting SaaS.

Be the Meteor.

10 Elite Tools. 1 Stack.