M
M
Mracula2022-03-22 07:40:44
PHP
Mracula, 2022-03-22 07:40:44

How and what content should be inserted into og:description correctly?

There is such a structure in opencart

<?php foreach ($add_this_meta as $meta) { ?>
  <meta property="og:<?php echo $meta['property'] ?>" content="<?php echo $meta['content'] ?>" /> 
  <?php } ?>

All tags are substituted there correctly except description, this tag is taken not from the meta_description field, but from the description in the product card.

< meta property="og:description" content="Описание из карточки товара /> 
    <meta property="og:title" content="Tайтл" /> 
    <meta property="og:url" content="https://domen.ru/canare-2s9f-gry" /> 
    <meta property="og:image" content="https://domen.ru/image/cache/catalog/li/default/25.jpeg" /> 
    <meta property="og:image:width" content="630" /> 
    <meta property="og:image:height" content="525" />

Where to dig I can not understand. And in general, can it be correct that
in meta name="description" content there is content from meta_description and in meta property="og:description" another one from the product card?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Arsentiev, 2022-03-22
@Mracula

All tags are substituted there correctly except description, this tag is taken not from the meta_description field, but from the description in the product card.

so it should be.
you were misled by the fact that both description and description are there, but these are fields that are different in purpose.
  • meta name="description" - it is for search engines, so the meta_description tag is taken. Keywords, rich snippet, etc. are shoved there.
  • meta property="og:description" - this is for social networks to share a link (for example, to a product) and then a link to the product, title, description, photo, price, etc. will be visible on the social network, so it is logical to add a description of the product, not a search tag.

however, I do not see a big problem if you add the usual search description there, because not every product has its own description, and meta-description is usually available for all pages on the site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question