Table of contents
1.
Introduction
2.
Understanding Open Graph Meta Tags
3.
Different classes of Open Graph Meta Tags
3.1.
1. og:type
3.2.
2. og:url
3.3.
3. og:description
3.4.
4. og:title
3.5.
5. og:image
4.
Adding Open Graph Tags to Your Website
4.1.
Adding Open Graph Meta Tags to WordPress
4.2.
Adding Open Graph Meta Tags to Shopify
4.3.
Adding Open Graph Meta Tags to Squarespace
4.4.
Adding Open Graph Meta Tags to Wix
4.5.
Adding Open Graph Meta Tags Manually
5.
Testing and Debugging Open Graph Meta Tags
6.
Benefits of Open Graph Meta Tags
6.1.
Manage the data that is shown to the audience
6.2.
Sync Content on Your Site with Facebook Posts
6.3.
Location and Group Targeting
6.4.
Regular Updates to the List of Open Graph Elements
6.5.
Enhance Your Social Media Posts
7.
Frequently Asked Questions
7.1.
What is a Schema Markup?
7.2.
Differentiate between Open Graph and Schema.org.
7.3.
List some important properties to be kept in mind while creating an Open Graph Meta Tag.
7.4.
How do I add HTML meta tags?
7.5.
How do Twitter Cards work?
8.
Conclusion 
Last Updated: Mar 27, 2024
Easy

Open Graph Meta Tags

Author Muskan Singh
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Online retailers may reach a far larger audience by showcasing their brand on social media, a vast field of opportunity. Nevertheless, have you ever noticed that not all of the links you share go to content pertinent to Facebook or other platforms? Social media posts may appear irregular and even strange, which not only makes people avoid clicking but also fails to grab their attention at all.

An essential component of a marketing strategy is sharing material in the proper manner on social media. Do you, however, understand how to maximize the potential of the content you share? The solution is Open Graph meta tags. Links to your website and blogs should be appealing and informative, and you may manage how your postings show on Facebook and other social media platforms by using open graph meta tags.

open graph meta tags

Understanding Open Graph Meta Tags

The OG meta tag is the snippet of code that manages how URLs display on social networking. It is a component of Facebook's original protocol and is also used by Twitter and LinkedIn.

The Open Graph protocol governs what content appears when sharing links on social media. Using Open Network tags transforms any website into a rich object in the social graph. You can manage the image, title, and description that appear when sharing links on social media, for instance, by using the Open Graph protocol.

Facebook, Twitter, and LinkedIn are just a few social media sites that accept Open Graph tags. On the other hand, Twitter also uses meta tags known as Twitter Cards. But if there are no Twitter Card tags, it will use Open Graph instead.

Different classes of Open Graph Meta Tags

These Open Graph tags are located in the head> portion of a web page. In HTML, they are the "og:" meta attribute. Go to the Open Graph Protocol website to view every form of Open Graph tag. Different Open Graph tags are available.

1. og:type

The content type is specified by the object type meta tag. Websites, articles, music, videos, and other object categories are a few examples of the types of objects you can employ. The content will display differently depending on the object type you pick.

A unique attribute is needed for some object types. To specify a single song, for instance, use "music.song," and to define an album, use "music:album." It defaults to "website" if you don't specify a type.

This code must be added to your page to use this tag:

<meta
property=“og:type” 
content=“type tag 
(website, video, etc)” />

2. og:url

The page's URL is specified via the URL meta tag. It serves as the content's permanent ID. The link published on social media networks will stop working if the URL is changed.

Use the canonical URL and keep your URLs short and straightforward. A canonical URL combines metrics and metadata from all posts posted with the same URL.

The code to use with this tag is as follows:

<meta property=“og:url” 
content=“url link here” />

3. og:description

You can add a brief description using this tag, which will show up when you share the page on social media. You may tell your viewers what to expect on the page with the help of this description. You shouldn't waste time incorporating keywords into the description because it won't affect your search engine optimization (SEO) efforts. Deliver an engaging and informative description to encourage users to click on your link.

Use this code to include this feature as one of your open graph tags:

<meta
property="og:description" 
content="Your brief description here." 
/>

4. og:title

This tag specifies the web page's title. Take your blog post's title as an example. When you share web material on your Facebook page, you can choose the title that displays using this tag. If you don't use this element, Facebook will automatically grab your page's meta title tag..Using this tag, you can develop a catchy headline that encourages Facebook readers to click on your content. Make sure your title is catchy, concise, and compelling to get clicks. It should also be no longer than 60 characters. To prevent truncation, this length is ideal.

Use this code to include this feature as one of your open graph tags:

<meta 
property=“og:title” 
content=“page title here” 
/>

5. og:image

You can use this tag to specify the thumbnail for your item when you share it. It describes the picture you want to show. It makes your content stand out, draws clicks, and promotes engagement. The image resolution, file size, and kind are important. For instance, the ideal image size for sharing on social media is 1200 x 628 pixels. 200 × 200 pixels is the bare minimum. JPEG, GIF, or PNG image formats are recognized as acceptable image types. Also, make sure the image file is no larger than 5MB.

Use this code to implement this open graph tag:

<meta
property="og:image" 
content="your-image-url.png"
/>

Adding Open Graph Tags to Your Website

In the HTML code for your page, include the Open Graph tags. The header.php file can manually add the necessary tags.

The following four Open Graph characteristics must exist:

  • og:url
  • og:title
  • og:description
  • og:image
     

Consider employing a markup generation tool like Mega Tags or Web Code Tools to avoid syntax problems.Do you use a CMS like Squarespace, Shopify, Wix, or WordPress? These platforms can automatically add Open Graph tags either through built-in functionality or plugins. WordPress plugins like Yoast SEO or Rank Math, for instance, are great choices.

Adding Open Graph Meta Tags to WordPress

The fastest, easiest and most popular way to add OG tags to your WordPress site is to install the Yoast SEO Plugin. Chances are, if you have optimized your website for SEO, you already have this plugin installed. On the back end of your website, navigate to the editor for the post or page you want to add Open Graph to, scroll down to the Yoast SEO box and navigate to the ‘social’ tab. Inside the ‘Facebook’ accordion, fill out the input fields to set the og:image, og:title and og:description tags. 

You don’t need to manually set the og:url tag or other tags such as the Twitter Card or image dimensions – as Yoast does this automatically. Also, if you do not set up an OG image on the post, but it does have a featured image, then Yoast will default to this and use it as your og:image. It's great practice to set a sitewide image so that it will always be displayed in the snippet whenever your website is shared, even if the URL doesn't already have an og:image manually specified. This will only be shown on the snippet if a specified URL has no custom og:image tag set.

Adding Open Graph Meta Tags to wordpress

Go to Yoast's main settings page to set a default sitewide og:image. On WordPress' left-hand menu, locate and navigate through:

Yoast >Social >Facebook

Upload the image you want to serve as the default after setting the toggle to "enabled." We advise using a generic brand image, such as the logo.

Adding Open Graph Meta Tags to Shopify

Most Shopify themes derive Open Graph information automatically from elements like the featured image and title tag.  This greatly reduces your customization and makes it incredibly simple to ensure that OG is implemented on your website. If necessary, you may manually inspect or modify the OG tags on your Shopify website from social-meta-tags.liquid in the code editor.

However, you can customize the sitewide og:image tag that will be applied as a fallback in the event that the shared page lacks a featured image selected through Shopify's interface.

You can configure this image in the shop settings; to access them, go to;

Online Store > Preferences > Social Sharing Image Preview

To ensure that it is always pertinent, regardless of which page of your Shopify site is being shared, use a generic brand image, such as the logo.

Adding Open Graph Meta Tags to Shopify

Adding Open Graph Meta Tags to Squarespace

Squarespace utilizes the page meta title and description for the OG tags automatically, however, you can set a unique og:image for each page. To set the picture you wish to appear on social media when the page is shared, go to the following:

Page Settings>Social Image>Upload

Unfortunately, the user interface only allows you to modify this one Open Graph tag; however, you can update the code editor's default options and add more OG tags. This can be done by navigating to the:

Page Settings>Advanced>Page Header Code Injection

Here, you can manually modify the current tags and add any additional ones you might require.

Don't let the manual coding turn you off! The difficult part has already been done for you; all you need to do is copy and paste the following code from the manual installation section below and alter the contents of each tag to what you wish to display.

Adding Open Graph Meta Tags to Squarespace

Adding Open Graph Meta Tags to Wix

Setting up Open Graph is simple with Wix. You can add unique page names, descriptions, photos, and a unique site-wide og:image. Wix does use the meta title and description to fill out the OG tags for each variable automatically, but you may alter them for your pages by going to:

Menus & Pages > 3 Dots (on the page you want to edit) > Social Share

From your Wix site's main menu, you can set a unique sitewide og:image by going to:

Settings>Social Share

This functions similarly to Yoast's or Shopify's sitewide og:image, working as a fallback for any pages where you haven't specified a specific picture to show. Choose a generic image that nevertheless accurately conveys the business, like your logo is ideal for this purpose.

open graph meta tags to wix

Adding Open Graph Meta Tags Manually

If your website isn't running on one of the aforementioned platforms and you feel comfortable working with coding, adding OG tags is very easy. Simply copy and paste the following into the appropriate section of your website, but don't forget to fill in your unique details!

<meta property="og:site_name" 
content="INSERT SITE NAME" />

<meta property=“og:title” 
content=“INSERT TITLE" />

<meta property="og:description" 
content="INSERT DESCRIPTION" />

<meta property="og:url" 
content="INSERT URL" />

<meta property="og:type" 
content="INSERT TYPE" />

<meta property="og:image" 
content="INSERT IMAGE URL" />

<meta property="og:image:width" 
content="1280" />

<meta property="og:image:height" 
content="640" />

<meta property="twitter:card" 
content="summary_large_image" />

<meta property="twitter:image" 
content="INSERT IMAGE URL" />


In order to minimize syntax problems, you should also think about using a markup generation tool like Mega Tags or Web Code Tools. The OG tags you require are automatically generated by our markup generator, lowering the possibility of any coding errors and getting rid of grammatical issues.

Testing and Debugging Open Graph Meta Tags

So, now you know Open Graph and how to implement it on your website. 

Your website should appear fantastic when shared on social media as you have incorporated all the tags.  However, you must verify their functionality prior to publishing your content. You may avoid any problems where the OG tags might not be pulled through or shown properly by testing your OG tags before sharing a URL.

We advise employing the subsequent tools to accomplish perfect functionality.It includes Twitter Card Validator, Facebook Sharing Debugger, Pinterest Rich Pins Validator, and LinkedIn Post Inspector. Simply paste the URL you want to check into any of these tools, and they will grab the OG tags from the website. You will then be demonstrated a preview of how it will appear when shared on the relevant social media network.

Make sure the image, title, and description are displayed appropriately while evaluating the appearance of the snippet of your URLs. You could see some pop-up alerts for irrelevant tags; you can choose to add these to your page or just ignore them since they won't help.

Update your tag and try again if something doesn't appear correct when you test your URL. Make careful to test the URL on each tool as well, just to be sure. Once you've done this, you're ready to start sharing!

Benefits of Open Graph Meta Tags

Although open graphs can assist in making sure that your material appears fantastic, their advantages go far beyond enhancing aesthetics.

The following are some advantages of including OG on your website:

Manage the data that is shown to the audience

The most significant advantage of OG is that it enables you to edit the content of a social media post while sharing one of your pages. You can alter titles, enhance how your information is presented, and raise your chances of drawing in interested viewers by using various tags.

Sync Content on Your Site with Facebook Posts

The content on your website and your Facebook postings are synchronized by OG, along with making sure that photographs, audio files, and video display correctly. With the right tools, you can sync comments, likes, and shares so that they show up on both your page and the shared postings.

Location and Group Targeting

Advanced OG experts can employ this technology to enhance location and group targeting, which limits the distribution of some content to users in a particular area.

Regular Updates to the List of Open Graph Elements

Because it can be modified to take into account the constantly shifting preferences of consumers, including OG, digital marketing has emerged as the new gold standard.

To help you make postings that are more interesting, the collection of graphic elements that are readily available is frequently updated to include new media kinds and other factors.

Enhance Your Social Media Posts

The most evident advantage of OG is that it can support the development of excellent posts. Social media users are less likely to view or connect with your material if the image in the post is hazy or the text is jumbled. Website managers can have more control over how their content is displayed by using open graph meta tags.

Frequently Asked Questions

What is a Schema Markup?

Search engines like Google and Bing use the HTML markup known as Schema. It aids with the comprehension of your material by search engines, improving its representation in search results. Schema markup enhances your page's appearance in search results by generating rich snippets. For instance, you could show a product's star rating in the search results.

Differentiate between Open Graph and Schema.org.

Search engines use schema markup to comprehend the material better and produce rich snippets in search results. Social networks use Open Graph markup to regulate how shared content appears in the feed.

List some important properties to be kept in mind while creating an Open Graph Meta Tag.

Use the canonical URL and keep your og:url short and to the point. Try to keep your og: title to 60 characters or less. Attempt to keep your og: description to 200 characters or less. Use high-quality photos for og: image with a minimum resolution of 1,200 x 628 pixels with a file size of 5 MB. Using a debugger tool, test your Open Graph markup. 

How do I add HTML meta tags?

Copy the meta tags for your website from a free tool like OpenGraph.xyz and paste them in the head> element before the closing /html> tag.

How do Twitter Cards work?

You can customize the look and post format of your tweets using Twitter Cards, a set of Social Meta Tags in the HTML of your website. These options specify the image, title, and description to fetch and display in an automatically created link preview when you share a link on Twitter. 

Conclusion 

We have briefly discussed the Open Graph Meta Tags, including different classes of Open Graph Meta Tags, different ways of adding Open Graph Tags to Your Website, and the importance of adding Open Graph Tags. We hope to have helped you better grip the Open Graph Meta Tags topic.

Recommended Reading - Canonical Cover In DBMS.

Visit our website to read more such blogs. Make sure you enroll in our courses, take mock tests, solve problems, and interview puzzles. Also, you can pay attention to interview stuff- interview experiences and an interview bundle for placement preparations. Do upvote our blog to help fellow ninjas grow.

Live masterclass