Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can You Have Your OpenGraph Object Link to a Different URL?

So you need a public URL with meta tags to represent an object in the OpenGraph, and one of the required meta tags is a URL property. When the action gets published, it links to this URL property.

Let's say I'm on http://mysite.com/A. It seems like I can't then do this:

<meta property="og:url" content="http://mysite.com/B"></meta>

Because Facebook will try to look at the root url for the meta tags. Is there any way to link to a different URL (mysite.com/B) from a given OpenGraph object URL (mysite.com/A)?

like image 462
choxi Avatar asked Sep 26 '11 20:09

choxi


People also ask

Is og URL necessary?

You do not ever need og:url . Instead, use the existing rel=canonical standard to link to your canonical page URL. Facebook's own documentation states they support this [1]. Facebook treats the following as redirects before scraping: HTTP redirects, rel=canonical links, and og:url .

What is meta property OG URL?

Open Graph meta tags are snippets of code that control how URLs are displayed when shared on social media. They're part of Facebook's Open Graph protocol and are also used by other social media sites, including LinkedIn and Twitter (if Twitter Cards are absent). You can find them in the <head> section of a webpage.

What is Open Graph image URL?

Open Graph (OG) is a technology that social networks like Facebook, Twitter, Pinterest, etc., use to pull data from your site when you add a URL of your site in any of your posts on these services.

What does OG URL do?

og:url This Open Graph tag is particularly useful if you have more than one URL for the same content and want to designate one for all your social shares. This tag will dictate the canonical URL for your page.


1 Answers

You should be able to link to another URL. But all an og:url means is "go over to that URL and use the tags from there instead". You can either

1) put all your tags on A and then redirect users to B with JavaScript or User-Agent detection;

2) put your content on A and do an og:url to B.

like image 133
Paul Tarjan Avatar answered Oct 08 '22 05:10

Paul Tarjan