Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Canonical url being linked on Facebook rather than real URL. Dynamic OpenGraph tags coming up empty

My website is a jobs website If I share a job at the moment the url could be for example

http://jobs.com/jobs/show-job/143/Jobit-flyers-put-up/Other/

But facebook with try to scrape http://jobs.com/jobs/show-job/ because that is the canonical url.

This really sucks when someone posts it on facebook because all the OpenGraph tags are empty so the link gets the wrong thumbnail and blank information. Who knows how to fix this?

like image 990
Josh Dean Avatar asked Apr 22 '12 08:04

Josh Dean


2 Answers

Fixed!

Inside the header of the dynamic page you are creating simply user the meta og tag

 <meta property="og:url" content="<?php get_current_url(); ?>" >
like image 98
Josh Dean Avatar answered Oct 02 '22 16:10

Josh Dean


Canonical URL is the URL that represent your OpenGraph object and this is intended to work that way!

You can see the answer I gave to similar question for more details.

like image 37
Juicy Scripter Avatar answered Oct 02 '22 15:10

Juicy Scripter