I have 2 plugins installed: YOAST and WP Meta SEO They both generate their own meta info, I prioritized WP Meta SEO, but the description is not retrieved by Google Search.
Page example: Page link example
Meta title:
Devenir PNC - Hôtesse de l'Air ou Steward | AirTraining
Meta Description:
Préparez le CCA et devenez Hôtesse de l'air ou Steward (PNC). Formation Théorique et Pratique, Anglais Intensif, Test de Sélection des Compagnies Aériennes.
Page rendered in Chrome :
<title>Devenir PNC - Hôtesse de l'Air ou Steward | AirTraining Academy</title>
<meta name="description" content="Devenir PNC - Hôtesse de l'Air ou Steward | AirTraining Academy | ">
We can see that the description includes the Page Title but not the description.
The Metabox form Yoast are retreiving the right Metas but they are not considered by Google.
Header of the theme:
<title><?php bloginfo('name'); ?><?php wp_title("|", true); ?></title>
<link rel="alternate" href="<?php bloginfo('url'); ?>"<?php get_permalink('url'); ?> hreflang="fr-fr"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?php wp_title();
echo ' | ';
bloginfo('description'); ?>">
<?php show_ata_jsonld_article() ?>
Should I optimize the header to find the correct meta ? Where i went wrong so the description displays the title ?
EDIT
I implemented the solution below from Priyanka Modi With Google Search Console, the meta data is retrieved correctly :
<meta name="description" content="Préparez le CCA et devenez Hôtesse de l'air ou Steward (PNC). Formation Théorique et Pratique, Anglais Intensif, Test de Sélection des Compagnies Aériennes.">
But results in Google Search are not displayed...
I guess i need to wait Google to fetch the new data again !
Add the following code in the archive template loop to display Yoast SEO meta description for each post.
<?php
$yoast_meta = get_post_meta($post->ID, '_yoast_wpseo_metadesc', true);
if ($yoast_meta) { //check if the variable(with meta value) isn't empty
echo $yoast_meta;
}
?>