Developers

How to use Variable Overrides to Override OG Tags

How to use Variable Overrides to Override OG Tags

Easily customize your social posts with Variable Overrides

In RebelMouse's Layout & Design tool, you have the ability to create variable overrides . This is helpful when you have to set Open Graph (OG) tags, which is a system of meta tags, in a section or post page or in the <head> tag of a page.

Facebook uses OG tags to generate the preview cards for shared articles and pages. Since these tags carry over the meta information that's been set for every page, you might want to override these tags for a particular social post. For instance, you may want to change what image displays on Facebook when you share your home page.


How to Override OG Image Tags

In the Layout & Design tool, use the hamburger menu (☰) to select Variable Override .

Next, click on the element Variable Override OG Image . In the Properties pane on the right-hand side, the settings for the element will appear. From there, you can upload the image you want to override the OG tag.

How to Override OG Tags for Title

First, add a Variable Override element like in the steps above. Then, select Facebook Share Title as the Variable.

Next, add the new title you want to use to override the original metadata:

Next, click Code to open up the code view for the element. There, you will want to change the Name attribute to remove the Post string.

For example, if the code is:

<add_to_content name="sharing_post_texts.facebook_title" value="New OG Title"/>

You will want to change it to:

<add_to_content name="sharing_texts.facebook_title" value="New OG Title"/>

In this example, your code view should look like the following:

Click Apply to save your changes.

How to Override OG Tags for Description

The process for overriding a description is similar to overriding a title. First, define the Variable , and then select Facebook Share Description to add your desired information.

Just like in the previous example, you will need to go into the code view and remove the Post string:

In this example, your code view should look like the following:

Click Apply to save your changes.

Using Variable Override to Override OG Image for Twitter

You can also use Variable Override elements to override OG images for Twitter. First, you will need to get the new image URL stored in RebelMouse.

In the Layout & Design tool, add the Image element to your page:

Then, upload your image:

After it's uploaded, right-click on the image and choose Copy Image Address . The address will be the URL for your OG override. You can delete the Image element and the image will be stored in your RebelMouse Digital Asset Manager (DAM).

Next, you will need to add two new Variable Override elements. For the first one, in Variable Name add page_card.type. In the Value field, add summary_large_image.

For the second Variable Override element, in Variable Name , type page_card.image . Then for the Value field, paste the URL of the image you previously uploaded to RebelMouse using the Image element. It should look like the following:

Here are some links to useful debugging tools for sharing URLs:

If you have any questions about Variable Overrides for social, email support@rebelmouse.com or contact your account manager today.

What Is RebelMouse?
Request a Proposal

Where
Websites Are Built

The Fastest Sites in the World Run on RebelMouse

Let’s Chat

new!

RebelMouse Performance Monitoring

Real-Time Core Web Vitals

Get Started
DISCOVER MORE

Our Core Features

Our platform is a complete digital publishing toolbox that's built for modern-day content creators, and includes game-changing features such as our:

Why RebelMouse?

Unprecedented Scale

RebelMouse sites reach more than 120M people a month, with an always-modern solution that combines cutting-edge technology with decades of media savvy. And due to our massive scale, 1 in 3 Americans have visited a website powered by RebelMouse.

120M+ Users
550M+ Pageviews
17+ Avg. Minutes per User
6+ Avg. Pages per User

Today's Top Websites Use RebelMouse

Thanks to the tremendous scale of our network, we are able to analyze a wealth of traffic data that informs our strategies and allows us to be a true strategic partner instead of just a vendor.

What Clients Say

We’re here to help you weigh and understand every tech and strategic decision that affects your digital presence. Spend less time managing everything yourself, and more time focused on creating the quality content your users deserve.

Case Studies

A Team Built Like No Other

RebelMouse employs a unique, diverse, and decentralized team that consists of 70+ digital traffic experts across more than 25 different countries. We have no central office, and we cover every time zone to ensure that we’re able to deliver amazing results and enterprise-grade support around the clock.

Our team is well-versed in all things product, content, traffic, and revenue, and we strategically deploy ourselves to help with each element across all of our clients. We thrive on solving the complex.

Let's Chat