Open graph description wrong

  • Posts: 220
  • Thank you received: 8
2 years 9 months ago #339267

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.28
-- PHP version -- : 7.3.33

Hi,
I just published the System Hikashop Social Networks plugin and enabled the Open Graph meta tag. Other options are disabled.

The tags og:title, og:type, og:image, og:url and og:site_name are correct.

But og:description is incorrect. It doesnot show the product meta description, as if should.
It shows the entire product description.

I found a way to correct this on a local copy of the website by changing the file plugins/system/hikashopsocial/ hikashopsocial.php

Original line 470

$ret->description = $element->product_description;
Changed line
$ret->description = $element->product_meta_description;

After this hack og:description indeed shows the product meta description.

I'm just a PHP amateur so probably this hack is not the right way to handle the problem.
But for some reason without this hack the meta description is not used in og:description.

Please advise.

Udo

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
2 years 9 months ago #339269

Hi,

Well, the meta description of the products is to set the meta description tag in the headers of the page:
www.w3schools.com/tags/tag_meta.asp
So I don't see the point of using the meta_description for the og:description tag since facebook would already be able to get the meta_description from the meta description tag.
I think it's more logical that the description is used for that tag.
Now if you want to use the meta description for the og:description tag, then of course, your modification would be necessary.
However, I'm not convinced that it would be more appropriate like that for everyone.
The main issue I see would be that the og:description tag would suddenly become empty for people who only filled the description and left the meta description empty in their products.

Please Log in or Create an account to join the conversation.

  • Posts: 220
  • Thank you received: 8
2 years 9 months ago #339292

Hi Nicolas,

Using the product description in og:description only works fine if the product description is very short, under 200 characters

In my website the product description has 100-150 words and often includes a table with the specifics of variants. Then og:description is way too long.
Then using the meta description instead makes it possible to use the plugin. Especially og:image is important to me.

Like you said the effect of my hack is that meta description and og:description are identical. So what's the use? Maybe it's superfluous.
Perhaps it doesnot make sense to have og:description if one already uses the meta description?

In the Hikashop Social Networks plugin you might introduce for og:description the choice between product description, meta description or none at all.

regards,
Udo

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
2 years 9 months ago #339310

Hi,

Well, both are for different things. The meta description tag is for search engines indexing. So it's important to adapt the text to get better SEO (more keywords to be searched while still readable).
The og:description tag is for Facebook sharing so it's important that the text can be read by normal humans.
So both are useful for different things and you don't necessarily want the same thing on both.

All in all, it doesn't matter much as long as they are filled.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum