Facebook Debugger doesn't see my Open Graph code - facebook-opengraph

I cannot figure out why Facebook Debugger only sometimes sees my open graph code. Here is a page where it CAN see my code: https://buckscountyalive.com/articles/railroad-attractions.cfm
My code:
<meta property="og:title" content="Hop Aboard a Vintage Railroad" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://buckscountyalive.com/articles/railroad-attractions.cfm" />
<meta property="og:image" content="https://buckscountyalive.com/facebook/trains.jpg" />
<meta property="og:description" content="Take a ride through time on these three tourist-friendly railroads!" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="fb:app_id" content="HidingForThisPost" />
Here's a page where it doesn't see my code: https://buckscountyalive.com/advertise/shop-local-gift-guide.cfm
My code:
<meta property="og:title" content="Get your products in our local Holiday Gift Guide" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://buckscountyalive.com/advertise/shop-local-gift-guide.cfm" />
<meta property="og:image" content="https://buckscountyalive.com/facebook/giftguide.jpg" />
<meta property="og:description" content="Reach customers in Bucks, Montgomery, Lehigh & Hunterdon" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="fb:app_id" content="HidingForThisPost" />
What's interesting is that if I use HootSuite to create a Facebook post, it sees all of my open graph code and posts it beautifully on Facebook. HOWEVER, if someone then tries to SHARE that post, the open graph code is lost. Any help would be GREATLY appreciated.

Related

Linkedin post inspector is not matching the correct OG:title value

Im using Wordpress and Yoast SEO plugin on my site.
This is my current meta tags structure, including title tag:
<!-- This site is optimized with the Yoast SEO Premium plugin v16.9 (Yoast SEO v16.9) - https://yoast.com/wordpress/plugins/seo/ -->
<title>Watch Now: Conversation Between XXXX and XXXXXXX</title>
<meta name="description" content="A description about the Conversation Between XXXXXXX and XXXXX, adding more characters to reach > 156 characters long with some extra words" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="article" />
<meta name="title" property="og:title" content="Conversation Between XXXXXX and XXXXXXX" />
<meta property="og:description" content="A description about the Conversation Between XXXXXXXXX and XXXXXXXX, adding more characters to reach > 156 characters long with some extra words" />
<meta property="og:url" content="https://xxxxxx.xxxxxxxx.xxxxx/xxxxxxx-xxxx-initiative-xxxxxx-2022-xxxxx-xxxxx/?x=xxxxxx-xxxxxx-xxxxxxxx-xxxxx-a-xxxxx" />
<meta property="og:site_name" content="xxxxxxx xxxxxx" />
<meta property="article:publisher" content="https://www.facebook.com/xxxxxxxxxx/" />
<meta property="article:modified_time" content="2023-02-06T15:33:14+00:00" />
<meta property="og:image" content="https://pr-xxxxxxxxxxx.pantheonsite.io/wp-content/uploads/xxxxxxx/01/xxxxxxxx-1152x627.png" />
<meta property="og:image:width" content="1536" />
<meta property="og:image:height" content="1024" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Watch Now: Conversation Between xxxxxx xxxxxx and xxxxx xxxxxx xxxxxxxxx" />
<meta name="twitter:description" content="A description about the Conversation Between xxxxxxx xxxxxx and xxxxxxx xxxxxxx xxxxxx, adding more characters to reach > 156 characters long with some extra words" />
<meta name="twitter:image" content="https://pr-xxxxx-xxxxxxx.xxxxxxx.io/wp-content/uploads/2022/09/29841515785_3968b60343_o-1-1.jpg" />
<meta name="twitter:site" content="#xxxxxxxxxx" />
<script>[....]</script>
<!-- / Yoast SEO Premium plugin. -->
I've also tried this meta tag format not working too
<meta prefix="og: http://ogp.me/ns#" property="og:title" content="%s" />
The value picked as title is not present in the html output of the page.

Some meta tags not added to head when rendered via component

I have a MetaTags.tsx component that has the following structure;
const DEFAULT_IMAGE = {
url: OgImage, //cloudinary url
width: '1200',
height: '630',
};
const MetaTags: FunctionComponent<Props> = (props) => {
const url = props.url ? `${BASE_URL}${props.url}` : BASE_URL;
const title = props.title || DEFAULT_TITLE;
const description = props.description || DEFAULT_DESCRIPTION;
const image = props.image || DEFAULT_IMAGE;
const type = props.type || DEFAULT_TYPE;
return (
<>
<meta name="description" content={description} />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:card" content="summary" />
<meta property="og:title" content={title} />
<meta property="og:url" content={url} />
<meta property="og:description" content={description} />
<meta property="og:type" content={type} />
<meta property="og:site_name" content="Example.com" />
<meta property="og:locale" content="en_GB" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:user_generated" content="false" />
<meta property="og:image" content={image.url} />
<meta property="og:image:width" content={image.width} />
<meta property="og:image:height" content={image.height} />
</>
);
};
export default MetaTags;
Then I import this MetaTags component on a page component like so
import React, { FC } from 'react';
import Head from 'next/head';
import MetaTags from '../head/MetaTags';
const ExamplePage: FC = () => {
return (
<>
<Head>
<title>Example Page</title>
<MetaTags
title="Example Page"
url="example-page"
description="Example Page Description"
/>
</Head>
</>
);
};
However, the following meta tags do not get added to the head tag
<meta property="og:image:user_generated" content="false" />
<meta property="og:image" content={image.url} />
<meta property="og:image:width" content={image.width} />
<meta property="og:image:height" content={image.height} />
Same issue occurs if I add the meta tags directly on the page component inside the Head component, instead of using the MetaTags component to return the meta tags.
Using version next#12.0.10
Any help would be greatly appreciated.

Head section updated on Next js not visible in source code

I am using Next js for for my website and added Head section on every page for SEO
Here's my code for All Blogs page. I have imported withRouter so that I can use router in Head section
const head = () => {
<Head>
<title>Mental health blogs | {APP_NAME}</title>
<meta
name="description"
content="Mental Health blogs and tutorials on how to live mental-illness free"
/>
<link rel="canonical" href={`${DOMAIN}${router.pathname}`} />
<meta
property="og:title"
content={`Latest mental health blogs | ${APP_NAME}`}
/>
<meta
property="og:description"
content="Mental Health blogs and tutorials on how to live mental-illness free"
/>
<meta property="og:type" content="website" />
<meta property="og:url" content={`${DOMAIN}${router.pathname}`} />
<meta property="og:site_name" content={`${APP_NAME}`} />
<meta property="og:image" content={`${APP_NAME}`} />
<meta property="og:image:secure_url" content={`${APP_NAME}`} />
<meta property="og:image:type" content={`${APP_NAME}`} />
<meta property="fb:app_id" content={`${FB_APP_ID}`} />
</Head>;
};
My All Blogs page is Server Side rendered. When viewing my source code of this page, I can't see my meta title, meta desc etc. Any idea what is going wrong here. Thanks in advance!

Using Schema.org itemprop on Facebook OG meta tags

Right now I'm using itemprop COMBINED with Facebook Open Graph <meta> tags like the following:
<html class="no-js" itemscope="itemscope" itemtype="http://schema.org/WebPage">
// ...
<meta property="og:type" content="website" />
<meta itemprop="name" property="og:title" content="My Title" />
<meta itemprop="image" property="og:image" content="http://example.com/socialimage.jpg" />
<meta itemprop="url" property="og:url" content="http://example.com" />
<meta itemprop="description" property="og:description" content="My description" />
<meta property="og:site_name" content="My Site"/>
Is this acceptable/valid to do?
itemprop is defined by Microdata, property is defined by RDFa. So your question is: Can Microdata and RDFa be used on the same meta element?
Yes, as I have explained in a similar (but not identical) question:
When using Microdata on meta, the following attributes are not allowed: name, http-equiv, charset. When using RDFa on meta, these three attributes are optional. In both cases the content attribute is required.
Note that you could stop using Microdata and use RDFa also for Schema.org:
<html typeof="schema:WebPage">
<!-- … -->
<meta property="og:type" content="website" />
<meta property="og:title schema:name" content="My Title" />
<meta property="og:image schema:image" content="http://example.com/socialimage.jpg" />
<meta property="og:url schema:url" content="http://example.com" />
<meta property="og:description schema:description" content="My description" />
<meta property="og:site_name" content="My Site"/>
Also note that you should use link instead of meta when the value is a URL:
<meta property="og:type" content="website" />
<meta property="og:title schema:name" content="My Title" />
<link property="og:image schema:image" href="http://example.com/socialimage.jpg" />
<link property="og:url schema:url" href="http://example.com" />
<meta property="og:description schema:description" content="My description" />
<meta property="og:site_name" content="My Site"/>
It looks like it will work, but just to let you know, Google's policy is to ignore hidden markup. So, just something to keep in mind.
Try this Whole code in your Header File:
This Script Code for Schema Data:
<script type='application/ld+json'>
{
"#context": "http://www.schema.org",
"#type": "LocalBusiness",
"name": "website",
"url": "http://www.website.com/",
"logo": "http://www.website.com/images/logo.png",
"image": "http://www.website.com/images/dhaka-city.jpg",
"title": "Title of your website | website.com",
"description": "website.com is your online business directory of Country",
"address": {
"#type": "PostalAddress",
"streetAddress": "Road #21, Gulshan, Dhaka, Bangladesh ",
"addressLocality": "Gulshan",
"addressRegion": "Dhaka",
"postalCode": "1200",
"addressCountry": "Bangladesh"
},
"telephone": "+880123456789",
"geo": {
"#type": "GeoCoordinates",
"latitude": "23.783127",
"longitude": "90.394359"
},
"openingHours": "Su, Mo, Tu, We, Th, Fr 09:00-18:00",
"contactPoint": {
"#type": "ContactPoint",
"contactType": "Customer support & query",
"telephone": "+880123456789"
}
}
</script>
Schema.org markup for Twitter:
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="#website">
<meta name="twitter:creator" content="#website">
<meta property="twitter:url" content="http://www.website.com/" />
<meta name="twitter:title" content="Title of your website | website.com">
<meta name="twitter:description" content="website.com is your online business directory of Country">
<meta name="twitter:image" content="http://www.website.com/images/dhaka-city.jpg">
Open Graph data:
<meta property="og:title" content="Title of your website | website.com"/>
<meta property="og:type" content="Most popular business directory of Bangladesh"/>
<meta property="og:url" content="http://www.website.com/"/>
<meta property="og:image" content="http://www.website.com/images/dhaka-city.jpg"/>
<meta property="og:site_name" content="#website"/>
<meta property="fb:admins" content="Author"/>
<meta property="og:description" content="website.com is your online business directory of Country"/>

Using operating hours in Open Graph business object type

How do I properly add markup for business hours that are part of the Facebook Open Graph meta tags for the business object property?
For example, how would I represent the following business hours: Mon-Fri: 9am-5pm?
To include Mon-Fri: 9am-5pm in the Open Graph meta tags you will need to mark up each day in its own group like so:
<meta property="business:hours:day" content="monday" />
<meta property="business:hours:start" content="09:00" />
<meta property="business:hours:end" content="17:00" />
<meta property="business:hours:day" content="tuesday" />
<meta property="business:hours:start" content="09:00" />
<meta property="business:hours:end" content="17:00" />
<meta property="business:hours:day" content="wednesday" />
<meta property="business:hours:start" content="09:00" />
<meta property="business:hours:end" content="17:00" />
<meta property="business:hours:day" content="thursday" />
<meta property="business:hours:start" content="09:00" />
<meta property="business:hours:end" content="17:00" />
<meta property="business:hours:day" content="friday" />
<meta property="business:hours:start" content="09:00" />
<meta property="business:hours:end" content="17:00" />
The property tags for hours (business:hours:start and business:hours:end) can be written in any of the following formats:
Examples for 1 PM
13:00 (24-hour notation)
1:00 PM (12-hour clock with period in uppercase)
1:00 pm (12-hour clock with period in lowercase)
A single day must consist of at least the three fields:
business:hours:day
business:hours:start
business:hours:end

Resources