Get AI SEO for FREE.
Support › Rank Math Free › help me to remove datePublished
5 years, 7 months ago
need to remove date / json ld
,”datePublished”:”2019-05-20T18:45:45+00:00″,”dateModified”:”2019-05-21T18:10:23+00:00″
Do you have any setting to stop displaying those values
please help me Thanks in advance
seo-by-rank-math/includes/modules/rich-snippet/snippets/class-author.php seo-by-rank-math/includes/modules/rich-snippet/snippets/class-article.php seo-by-rank-math/includes/modules/rich-snippet/class-jsonld.php
Hello Gopi,
Thank you for getting in touch.
You can use this filter in your theme’s functions.php file to remove certain OpenGraph tags:
https://rankmath.com/kb/filters-hooks-api-developer/#remove-opengraph-tags
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thanks for your reply i have added the piece of code
add_action( ‘rank_math/head’, function() { global $wp_filter; if ( isset( $wp_filter[“rank_math/json_ld”] ) ) { unset( $wp_filter[“rank_math/json_ld”] ); } });
let me check how it works
HI there,
Thanks for the follow up.
If you intend to remove all the json_ld data from your posts then this code should be able to work perfectly.
Let us know how this goes. Thank you.
i want to remove only date, then what change do i need to make.
Please hellp
thanks in advance
Hello,
To disable the datePublished property in the Schema.org data for your articles, you can use the following code:
datePublished
add_filter( 'rank_math/snippet/rich_snippet_article_entity', function( $data ) { unset( $data['datePublished'] ); return $data; }, 10, 1 );
Hope that helps.
5 years, 6 months ago
Thanks its working fine
Hi there,
I am glad that this is now resolved 🙂
Feel free to contact us should any other issues come up.
The ticket ‘help me to remove datePublished’ is closed to new replies.