Plugin Support
Suwash
(@suascat_wp)
@jacky_k,
Are you trying to hide the article published date? You can use this filter.
add_filter( 'wpseo_og_article_published_time', '__return_false' );
This filter does not work.
I just tested the filter and the return false removes the Open Graph published time as expected on a post.
To be sure we’re on the same page, this filter applies to this line as output by Yoast SEO:
<meta property="article:published_time" content="2020-05-09T17:03:46+00:00" />
Can you elaborate on what you are seeing and what you expect to see? Are you changing the published time of a post, page, taxonomy or custom post type?
Yes, these filters to remove modified/updated time do not work.
add_filter( 'wpseo_og_article_published_time', '__return_false' );
add_filter( 'wpseo_og_article_modified_time', '__return_false' );
add_filter( 'wpseo_og_og_updated_time', '__return_false' );
I want to remove:-
<meta property="article:modified_time" content="2020-05-10T14:11:26+00:00" />
add_filter( 'wpseo_opengraph_show_publish_date', '__return_false' );
I need to not hide the date. I need to change the publication date.
@mihdan how to hide property=”article:modified_time” ?
@satindersingh There is no filter π
But there is a solution:
add_filter(
'wpseo_frontend_presenter_classes',
function ( $filter ) {
if (($key = array_search('Yoast\WP\SEO\Presenters\Open_Graph\Article_Modified_Time_Presenter', $filter)) !== false) {
unset($filter[$key]);
}
return $filter;
}
);
@mihdan thanks a lot for sharing best solution π
@jacky_k Can you please confirm whether you were able to resolve this by using the @mihdan provided solution?
@mazedulislamkhan, yes @mihdan’s solution helped me. But I hoped that the developers will return the desired filter.
Hi,
I don’t get this, how is this issue resolved?
After the big frontend change in version 14.x, none of these filters are working anymore. Sure the workaround from @mihdan works, but (again) a good working filter is gone.