-
AuthorPosts
-
May 16, 2018 at 6:47 am #957325
Is there a way to keep the “Schema.org HTML Markup” option active (in Layout Builder) and remove the data published time and modified time?
Basically, I don’t want to show the published data in Google search results. If I keep the “Schema.org HTML Markup” option active it will appear on the Google search result snippet.
I want to know if I can remove these strings created by that Enfold Schema.org option:
<span class=’av-structured-data’ itemprop=”datePublished” datetime=””>2018-04-29 06:45:26</span><span class=’av-structured-data’ itemprop=”dateModified” itemtype=”https://schema.org/dateModified”>2018-05-02 05:10:40</span>
If can help, I managed to remove the date published time created by Seo By Yoast plugin with this filter in functions.php:
add_filter( ‘wpseo_og_article_published_time’, ‘__return_false’ );
Any idea?
Thanks.
May 17, 2018 at 1:15 pm #958136Hey alejandrox86,
Please try using a plugin such as this one – https://wordpress.org/plugins/wp-old-post-date-remover/
Also others have done this by setting the Meta description manually in Yoast SEO: https://yoast.com/meta-descriptions/Best regards,
MikeMay 17, 2018 at 1:59 pm #958150Hello Mike,
thanks for the reply. I tried almost every ‘data remover’ plugin and they all work.I also added in functions.php:
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’ );
add_filter( ‘wpseo_opengraph_show_publish_date’, ‘__return_false’ );add_filter(‘the_time’, ‘__return_false’);
add_filter(‘get_the_time’, ‘__return_false’);
add_filter(‘the_modified_time’, ‘__return_false’);
add_filter(‘get_the_modified_time’, ‘__return_false’);
add_filter(‘the_date’, ‘__return_false’);
add_filter(‘get_the_date’, ‘__return_false’);
add_filter(‘the_modified_date’, ‘__return_false’);
add_filter(‘get_the_modified_date’, ‘__return_false’);They all work too.
But the Enfold “Schema.org HTML Markup” option add an extra meta data info which is undetectable by those plugins.
Any other idea?
Best Regards,
Alessandro.May 18, 2018 at 2:02 am #958372Hi,
Did you try setting the Meta description manually in Yoast SEO: https://yoast.com/meta-descriptions/ ?
My research found this as a solution. Would you like to try using “display:none” on the time element, perhaps Google will obey this.Best regards,
MikeMay 18, 2018 at 2:28 am #958377Hi, thanks for the reply again.
I managed to hide the Seo By Yoast meta data infos with the functions.php filters and “display:none”.
If I keep the Enfold “Schema.org HTML Markup” deactivated everything is fine and I see no meta data info.
The problem is when the “Schema.org HTML Markup” option is active. I should hide or delete the meta data info from that Enfold function.
“Schema.org HTML Markup” creates an additional string with the published time meta data which can’t be hidden by a “display:none”.
May 18, 2018 at 3:37 am #958396Hi,
I tested editing the schema code in /enfold/includes/helper-markup.php
I removed lines 369 though 378:if( !in_array('date', $exclude) ) { $output .= "<span class='av-structured-data' {$entry_time_markup}>{$post->post_date}</span>"; } if( !in_array('date_modified', $exclude) ) { $output .= "<span class='av-structured-data' {$date_markup}>{$post->post_modified}</span>"; }
and it seems to remove all date and time from the blog posts.
please try and let us know if that helps.Best regards,
MikeMay 18, 2018 at 6:48 am #958445A-W-E-S-O-M-E! :)
That was what I was looking for. Thank you so much!
Best Regards,
Alessandro.
May 18, 2018 at 11:16 am #958547Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
And if there are features that you wish Enfold had, you can request them and vote the requested ones here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Remove Schema.org HTML Markup published date from post’ is closed to new replies.