Open Graph and Twitter Card Tags

Description

This plugin improves the sharing of your WordPress pages, posts, WooCommerce products, or any other post type on social media, by setting the correct Facebook Open Graph Tags.

It also allows you to add the Twitter Card tags for more effective and efficient Twitter sharing results, as well as the Meta Description and Canonical tags if no other SEO plugin is setting them.

This plugin is not, in any way, affiliated or endorsed by Facebook, Twitter, Google or any other 3rd party.

You can also choose to insert the “enclosure” and “media:content” tags to the RSS feeds, so that apps like RSS Graffiti and twitterfeed post the image to Facebook correctly.

It allows the user to choose which tags are included, and also the default image if the post/page doesn’t have one.

It’s also possible to add an overlay logo/watermark to the image. The plugin will resize and crop the original image to 1200×630 and then overlay the chosen 1200×630 PNG file over it.
It be usefull to add your brand to the image that shows up on Facebook shared links.

Our settings page is discreetly kept under “Options”.

The generated (Facebook) Open Graph Tags are:

og:title: From post/page/archive/tag/… title.

og:site_name: From blog title.

og:url: From the post/page permalink.

og:description: From our specific custom field of the post/page, or if not set post/page excerpt if it exist, or from post/page content. From category/tag description on its pages, if it exist. From tagline, or custom text, on all the others.

og:image: From our specific custom field of the post/page, or if not set from the post/page featured/thumbnail image, or if it doesn’t exist from the first image in the post content, or if it doesn’t exist from the first image on the post media gallery, or if it doesn’t exist from the default image defined on the options menu. The same image chosen here will be used and enclosure/media:content on the RSS feed.

og:image:url: Same as og:image.

og:image:secure_url: Same as og:image if SSL is being used.

og:image:width and og:image:height: Image dimensions.

og:type: “website” or “blog” for the homepage, “product” for WooCommerce products and “article” for all the others.

WooCommerce: On product pages sets og:type to “product” and adds the price including tax to the product:price and product:availability tags. Also allows you to use the Product Category thumbnails as Open Graph Image and have Product Gallery images as additional Open Graph Images

NEW PRO add-on:

To implement new features, we’ve released a new PRO add-on that you can use alongside this plugin.

From version 3.0.0 forward, for sustainability reasons, some advanced functionalities might be removed from the free plugin and move to the PRO add-on, with the proper deprecation notice with some versions in advance.

Installation

Use the included automatic install feature on your WordPress admin panel and search for “Open Graph and Twitter Card Tags”.

Activate the plugin through the Plugins menu in WordPress

Go to Options, Open Graph and Twitter Card Tags to set it up

FAQ

Why aren’t you active on the support forums?

Because of other commercial projects, including WordPress and WooCommerce plugins, we haven’t been able to reply to support tickets neither release new versions of this plugin, for which we are sorry.

We will fix any security issue that might arise but, at this moment, we cannot promise we’ll get back to active development and support on this plugin anytime soon.

If you reach us by email or any other direct contact means, we’ll assume you are in need of urgent, premium, and of course, paid-for support.

If some company wants to make a proposal to take ownership of this plugin, please contact us to info @ webdados .pt
We’ll not pass ownership of the plugin to anyone (person or company) that does not have a solid roadmap and business model for this plugin, to guarantee the current users that development and support will be resumed.

We also released a PRO add-on with some extra features and technical support (except for the free plugin features).

Facebook is not showing up the correct image when I share a post. What can I do?

Are you using a big enough image? The minimum image size is 200×200 pixels but we recommend 1200×630.

Are you sure you only have one og:image tag on the source code? Make sure you’re not using more than one plugin to set OG tags?

Go to the Facebook Sharing Debugger, insert your URL, click Debug. Then click on Scrape Again to make sure Facebook gets the current version of your HTML code and not a cached version. If the image that shows up on the preview (bottom of the page) is the correct one, then the tags are well set and it “should” be the one that Facebook uses when sharing the post. If it still does not use the correct image when sharing, despite the debugger shows it correctly, there’s nothing more we can do about that. That’s just Facebook being Facebook.

What is the “Manually update Facebook cache” button on the “Post updated” notice?

It’s a shortcut to the Facebook Sharing Debugger, where you should click on Scrape Again to make sure Facebook gets the current version of your post or page.

When I save/edit my post I get the “Facebook Open Graph Tags cache NOT updated/purged” error. Should I worry?

Each time you edit a post, if the option “Try to update Facebook Open Graph Tags cache when saving the post” is activated, we’ll try to notify Facebook of the changes so it clears up its cache and read the new Open Graph tags of this specific URL.
If this is a new post and it’s the first time you’re saving it, the error is “normal” and you should ignore it (we’re looking at a workaround to not show you this error).
If this is not a new post and it’s not the first time you’re saving it, and if this happens always, then maybe your server does not support calling remote URLs with PHP and you should disable the “Try to update Facebook Open Graph Tags cache when saving the post” option. In that scenario we recommend you use the Facebook Sharing Debugger to Scrape Again each time you update your post.
Sometimes the plugin just can’t update the Facebook cache itself and you may need to do it manually on the link provided above.

Can I authenticate the call to Facebook, with my own app, when trying to update the cache, so I get rid of the “An access token is required to request this resource” error?

Yes, you can. Create a Facebook App and fill in the details on the “Facebook Open Graph Tags cache” panel of the plugin settings page.
Do NOT ask us support on this. There is a blog post on our website explaining everything you need to do.

Facebook says “The following required properties are missing: fb:app_id”. Should I worry?

No. Move along.

How can I share my posts or products as Rich Pins on Pinterest?

Pinterest can read Open Graph tags, so no extra tags are needed to share your articles or WooCommerce products as Rich Pins.
You need however to apply to whitelist your domain on Pinterest. Head to this page and follow the instructions starting with “Set up”. When in the validator, enter your URL, hit “Validate” and then choose “HTML tags” and hit “Apply now”. It’s then up to Pinterest to accept your application or not.

Can this plugin get content from “random plugin”?

If there’s a popular plugin you think we could get content from to use on the meta tags, use the support forum to tell us that.
If you are a plugin or theme author you can always use our filters fb_og_title, fb_og_desc, fb_og_url, fb_og_type, fb_type_schema, fb_og_image, fb_og_image_additional, fb_og_image_overlay, fb_og_locale, fb_og_app_id, fb_og_thumb_fill_color, fb_og_output and fb_og_enabled to customize the Open Graph (and other) meta tags output.

What is the array structure for the `fb_og_image_additional` filter?

I’m getting a white screen of death / truncated HTML

Go to the plugin settings and check the Do not get image size option.
This happens on some edge cases we haven’t yet been able to identify.
Update: Probably fixed for some users on 2.1.4.5 and completely on 2.2 (pending confirmation)

Yoast SEO shows up a big warning if both plugins are active. Is the world in danger if I keep both plugins active?

No, it isn’t.
You can (and, in our opinion, you should) use both plugins. If you want to use Yoast SEO for your SEO needs and our plugin for social media meta tags you just have to go to “SEO > Social” and disable settings for Facebook and Twitter.
If you don’t find that option, because they’ve now made it harder to reach, you have to go to “SEO > Dashboard > Features > Advanced settings pages > choose Enabled and Save changes”. Then you can reach “SEO > Social”.
Then set up our plugin as you wish and you’re ready to go.
We like to work with everybody, so (if you want to) our plugin can even integrate with Yoast SEO and use it’s title, description and canonical URL on the Facebook and Twitter tags.

There’s a similar plugin on the repository, by Heateor. Is this the same?

It’s similar, yes. They’ve forked our plugin and gave no credits whatsoever for our original work.

It's been a great plugin up to now, user friendly and easy to use. But lately I have been having issues with it not posting preview thumbnails across to Facebook, and I am not sure if it's the plugin or Facebook that's the issue (high probability it's Facebook). Since the plugin is not being supported at the present time I have put it in deactivated state for now. Hopefully it will get updated in the future and I can start using it again.

For my team, this plugin is indispensable. The best feature is applying your own branding to an image using a transparent PNG. If you apply this feature, everything that is shared looks professional.
I'm running WP 5.3.2 with plugin version 2.2.7.2 without a hitch along with Yoast, WPML, and ACF.

2.2.1

2.2

Tool to clear all the plugin transients, thus resetting size caching for all images (use it only )

Small bug fix when the settings aren’t yet saved at least one time

When getting the image size, the full image is used again, instead of the partial 32Kb (that caused WSOD in some environments), but this can be overridden (and use the partial again) by returning false to the new fb_og_image_size_use_partial filter

Transient validity is now one week (now that we get the all image and the process can slow down the page load a bit), instead of one day

Fix when getting the image and description for the blog url when it’s set as a page (Thanks @alexiswilke)

Ability to disable image size cache (transients) completely by returning false to the new filter fb_og_image_size_cache (which we do NOT recommend)

Improved the FAQ

2.1.6.3

Fix the “Suppress cache notices” option (Thanks @digbymaass)

2.1.6.2

Default og:type to website on non-singular pages because Facebook deprecated it (Thanks @alexiswilke)

Automatically disable the overlay feature if GD is not installed (Thanks @tiagomagalhaes)

Set og:type to website instead of article when a page is set as a blog page

Use image from the page (our custom field, featured, etc…) when a page is set as a blog page (Thanks @alexiswilke)

Use description from our custom field when a page is set as a blog page

2.0.3

New default description field (WPML translatable) to be used on any website post / page / cpt / archive / search / … that has an empty description, instead of using the homepage description like we were using until now

Fixed some PHP notices and warnings

Small tweaks on the settings page

2.0.2

Fixed a PHP Notice on WPML root pages (Thanks @marcobecker)

New experimental feature: Added the possibility to set itemscope itemtype to the HTML Tag in order to avoid W3C and Structured Data validation errors

Updated settings page informations to include the existent filters for each option

2.0.1

Fixed a PHP Notice on the upgrade routine (Thanks @jluisfreitas)

Updated FAQs

2.0

We would like to thank Heateor, “a creative team with unique ideas in mind” (their words), for forking our plugin (although no credits whatsoever were made regarding our original work), and thus trully inspiring us to make this new version, using also their “unique” ideas, in the spirit of GPL, but giving them the deserved credit in the spirit of civism, integrity and the WordPress way of doing things

Revised and optimized code with better WordPress standards and best practices

0.5.1

0.5

0.4.3

Fixed a bug where the original, WordPress stock, Canonical URL was not being removed.

0.4.2

If using the “Business Directory Plugin” integration, the og:url tag is now correctly set in the category listing pages.

0.4.1

Added the ability to set/replace the Canonical URL tag. Very important for SEO in the “Business Directory Plugin” integration.

0.4

“Business Directory Plugin” plugin integration. It’s now possible to populate og:title, og:url, og:description and og:image tags with each listing details. If a featured image is set it will be used. If not, the listing main image is used.

0.3.5

0.3.4

Fixed a bug where all the settings could be lost when saving other plugins options (Shame on me!!).

0.3.3

Fixed a bug where unset options would become active again. Thanks to @scrumpit.

0.3.2

Fixed a typo on the settings page.

0.3.1

When saving the settings the $_POST array was showned for debug/development reasons. This output has been removed.

0.3

“SubHeading” plugin integration. It’s now possible add this field to the og:title tag.

Changed the way defaults and user settings are loaded and saved, to “try” to eliminate the problem some users experienced where the user settings would disappear.

Bugfix: “Also add image to RSS/RSS2 feeds?” option was not being correctly loaded.

The plugin version is now showed both as a comment before the open graph tags and on the settings page.

0.2.3

No changes. Had a problem updating to 0.2.2 on the WordPress website.

0.2.2

Bugfix: small change to avoid using the “has_cap” function (deprecated). Thanks to @flynsarmy.

0.2.1

Bugfix: when the og:image is not hosted on the same domain as the website/blog.

0.2

If the option is set to true, the same image obtained to the og:image will be added to the RSS feed on the enclosure and media:content tags so that apps like RSS Graffiti and twitterfeed post them correctly.

0.1.9.5

It’s now possible to choose how the post/page og:image tag is set. It means that if the user doesn’t want to use the featured/thumbnail image, or the first image in the post content, or the first image on the media gallery, or even the default image, he can choose not to.

0.1.9

Added the og:locale tag. This will be the WordPress locale by default, but can be chosen by the user also.

The og:type tag can now be set as “website” or “blog” for the homepage.

A final trailing slash can now be added to the homepage url, if the user wants to. Avoids ‘circular reference error’ on the Facebook debugger.

0.1.8.1

Fixed the namespace declarations.

0.1.8

Type “website” was being used as default for all the urls beside posts. This is wrong. According to Facebook Open Graph specification only the homepage should be “website” and all the other contents must bu “article”. This was fixed.

On Category and Tags pages, their descriptions, if not blank, are used for the og:description tag.

If the description comes out empty, the title is used on this tag.

0.1.7

Changed the plugin priority, so that it shows up as late as possible on the tag, and it won’t be override by another plugin’s Open Graph implementation, because other plugins usually don’t allow to disable the tags. If you want to keep a specific tag from another plugin, you can just disable that tag on this plugin options.

0.1.6

Settings link now shows up on the plugins list.

Small fix to ensure admin functions only are running when on the admin interface.

Some admin options now only show up when the tag is set to be included.

0.1.5

Fixed the way Categories and Tags pages links were being retrieved that would cause an error on WP 3.0.

Added the option to use a Custom text as homepage og:description instead of the Website Tagline.