- This topic has 13 replies, 4 voices, and was last updated 3 years, 5 months ago by David.
-
AuthorPosts
-
September 14, 2020 at 8:25 pm #1443465Sanu Kumar
How to remove dates from the search results? I am using rank math SEO plugin and there is nothing like that option and I contact their support staff and they replied me this
“The date is usually added by your theme and not Rank math. You will need to contact your theme support to help you remove this feature from your site.”September 14, 2020 at 8:34 pm #1443469ElvinStaffCustomer SupportHi,
Can you take a look at this? This post may help you.
https://generatepress.com/forums/topic/how-to-remove-date-preview-in-search-results/#post-944674Let us know if it works for you.
September 14, 2020 at 8:39 pm #1443471Sanu KumarI want to remove the dates from search results (SERPs), not from the blog post.
September 14, 2020 at 8:41 pm #1443476Sanu KumarI have seen many sites who are using Generatepress and their results on Google doesn’t show dates but they have a dates on the blog posts.
September 15, 2020 at 3:35 am #1443818DavidStaffCustomer SupportHi there,
The problem is, we can remove the date tags from the site, and help to display a static non time stamped date on the post – but we cannot control how Google interprets that.
when you say you have seen many sites where Date is displayed on site but not in SERPs. Can you share a link to one of them so we can see what they are doing ?
September 15, 2020 at 9:58 am #1444536TomLead DeveloperLead DeveloperWe can remove the microdata from the output, but then it’s up to Google whether they want to display the date or not (as David mentioned above).
add_filter( 'generate_post_date_output', function() { $time_string = '<time class="entry-date published">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="updated">%4$s</time>' . $time_string; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); return sprintf( // WPCS: XSS ok, sanitization ok. '<span class="posted-on">%1$s<a href="%2$s" title="%3$s" rel="bookmark">%4$s</a></span> ', apply_filters( 'generate_inside_post_meta_item_output', '', 'date' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string ); } );
October 28, 2020 at 8:15 pm #1508735Sanu KumarHello
When we update our old post, there is a published date show on the search results, but what will we have to do to show the last updated date?
Like this: https://ibb.co/28BtXYg
For example; We wrote an article on 1st January 2018 (it means it is an original published date) and I have updated the post in regular intervals like 3rd March 2019 and so on till date and when someone search on Google and if my article shows on search results then the date shows the original published date i.e 1st January 2018 but I have seen many sites whose date shows last updated date, so how can I also do that? Is there any option in Rank Math?
I have seen many sites who are using GP but their dates are showing last updated date on SERPs, could you help me with that what they are doing?
Like I have shared one site in a private field.
October 29, 2020 at 5:04 am #1509122DavidStaffCustomer SupportHi there,
which site is displaying the incorrect date ? I can take a look to see what timestamps are being added to the site.
Note: as we said before the Theme cannot control how Google determines the date to display.
October 29, 2020 at 5:47 am #1509159Sanu KumarHave a look on this site: https://www.guideblogging.com/
They are also using GP and I have seen their some post which was published last year which is its original published date and that same article shows in Search results with their last updated date like if they update their post recently then Google shows their recently updated date on search results
But,
In my case, my original published date is showing like my original published date was last year and I did some changes on a post and updated this year but Google shows the date on search results of last year which is an original published date.
You can take a look at their site and see if they are doing something different.
If Google controls this then leave it, I just asked because I have seen on other’s site but not on my site so that is why I asked.
Thanks
October 29, 2020 at 7:23 am #1509247DavidStaffCustomer SupportI would need to see a post on YOUR site to see if it is declaring a Modified Date.
October 29, 2020 at 7:29 am #1509253October 29, 2020 at 9:50 am #1509874DavidStaffCustomer SupportSo your site contains both the published and modified time meta attributes but is set to only display the Updated date in the post content – so this is valid.
If you want you can remove the Published dates altogether then you can use the snippet provided here:
https://docs.generatepress.com/article/generate_post_date_show_updated_only/
Other than that is is down to Googles bots and algorithms to determine whether it the SERP is worthy of an updated date.
October 29, 2020 at 10:03 am #1509897Sanu KumarCould you help me with this – How do I remove Published dates
October 29, 2020 at 10:34 am #1509932DavidStaffCustomer SupportYou simply need to add this PHP Snippet to your site:
add_filter( ‘generate_post_date_show_updated_only’, ‘__return_true’ );
This article explains adding PHP:
https://docs.generatepress.com/article/adding-php/
TLDR: Either add it to a Child Themes functions.php or use the Code Snippets plugin.
-
AuthorPosts
- You must be logged in to reply to this topic.