How to manually add WP SEO Description to og:description?
-
I don’t use og:type=website but og:type=business.business; therefore, I need to create the og-meta manually.
I found these solutions:
– https://www.ads-software.com/support/topic/plugin-wordpress-seo-by-yoast-get-the-custom-seo-description-for-ogdescription?replies=20
– https://www.ads-software.com/support/topic/plugin-wordpress-seo-by-yoast-fatal-error-using-this-when-not-in-object-context?replies=4#post-2505955I used this code:
<meta property=”og:description” content=”<?php $og_object = new WPSEO_Frontend(); $og_description=$og_object->metadesc(false); echo $og_description; ?>” />The code generates the correct description BUT it also quadruplicates all metas that are added by yoast. My Website shows 4 titles, 4 descriptions, 4 <meta name=”robots” content=”noodp,noydir”>.
When I remove <?php $og_object = new WPSEO_Frontend(); $og_description=$og_object->metadesc(false); echo $og_description; ?> everything is fine.
Is there any way to solve this?
Thanks for any suggestions!
- The topic ‘How to manually add WP SEO Description to og:description?’ is closed to new replies.