Hi Pete,
Did you set that in WordPress Dashboard > Rank Math > Titles & Meta > Pages > Rich Snippet?
If you haven’t entered a meta description yourself in the single page, the fallback will be what you set in the Titles & Meta
.
First preference will always be given to your single page/post description.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
No I did not edit the settings at all, it just has %exerpt% by default.
But I still don’t understand.
Does this mean that as all my pages are articles (which is already set as type) , then I don’t need to do add anything at all in the rich snippet field (assuming each page either has a meta description or an excerpt?
OK, I have checked the pages with Google structured data checker and everything seems to be OK with the description, however I am getting this error:
url (The value provided for logo.url must be a valid URL.)
Can you please explain what I do about this? (The site has a logo, all the pages have featured images)
url (The value provided for logo.url must be a valid URL.)
https://tamingthesaxophone.com
-
This reply was modified 5 years, 7 months ago by Pete.
Hi Pete,
Thanks for the response.
Would you mind sharing some temporary admin access to your site so that we can take a look at this for you? Please edit the sensitive data section and add the details.
Hope to hear back soon.
Hello,
Thank you for the patience.
I have just logged in and fixed the issue. You will however need to head over to Rank Math > Titles and Meta > Local SEO and define the most ideal logo to represent your organization. At the moment I have used your site logo.
I hope this info helps. Thank you.
Did you set that in WordPress Dashboard > Rank Math > Titles & Meta > Pages > Rich Snippet?
Still a bit confused.
In Rank Math > Titles & Meta > Pages > Rich Snippet I have set %excerpt%
However if a page does not have an excerpt, but it does have a meta description (Under general > Preview) then it seems Google does not use that instead. I would want Google to use the meta description as fallback if there is no excerpt – is that possible?
Hello,
Thank you for contacting Rank Math today.
The meta description that is set on individual posts should be able to override the global settings that have been set on Rank Math > Titles and Meta > Page settings. Please clear any cache on your site and resubmit your sitemap index for these changes to take effect.
Looking forward to helping you. Thank you.
Sorry, I wasn’t clear. I don’t mean the global description setting, what I mean is the structured data lower down the settings page
For example the rich snippet setting to use for description is %excerpt%
If there is no excerpt on the page, I want the structured data description to be the meta description as a fallback. But currently what happens if there is no excerpt, Google is just showing the first couple of lines of the page.
If there is an excerpt it shows it.
So I either need
1) a way for the meta description to be the Rich snippet fallback when no excerpt
OR
2) copy all meta description to the excerpt field.
Is either possible? Thanks
Hi there,
Thanks for the clarification.
In this case, I can suggest that you make use of the following code in your functions.php file to assign the post description to this entity:
/**
* Filter to Short-circuit Schema if a 3rd party is interested in generating their own data.
* Replace $schmea_type with schema name like article, review, etc.
* @param array $entity Snippet Data
* @return array
*/
add_filter( "rank_math/snippet/rich_snippet_article_type", function( $entity ) {
global $post;
if(!has_excerpt($post->ID)){
$entity['description'] = RankMath\Post::get_meta( 'description', $post->ID );
}
return $entity;
});
Let me know how this goes.
Thanks. I tried that and I just got a blank white page on my site 🙁