-
AuthorPosts
-
August 11, 2014 at 1:31 pm #82308
Hi,
In the past, all I have had to do to get Google to stop showing a time stamp for pages (and posts) in search results is install the Date Exclusion SEO Plugin and voilà, roughly one week later Google knocks this nonsense off. There have been a couple of instances for certain themes in which I have had to get into the appropriate files and change:
<?php the_time('F jS, Y') ?>
to:
<script language="javascript" type="text/javascript">document.write("<?php the_time('F jS, Y') ?>");</script>
This has, up until now, always been a universally similar process. These appropriate files within X, however, do not appear to be accessible due to the way the ‘stacks’ are set up (?).
The former method, the plugin, I installed over a month ago and Google is still showing the date stamp. The latter method I have not been able to try as I can’t figure out how to access the Integrity-specific files, nor am I sure which files would need to be altered for the X theme.
Please advise,
AJAugust 11, 2014 at 1:54 pm #82326Hi AJ,
I’m really sorry for the issue you’re facing!
To do you need you need to create a child theme first, please follow this KB: http://theme.co/x/member/kb/how-to-setup-child-themes/ & create a child theme. Then open your child theme’s functions.php file & paste the following codes into it:
function x_integrity_entry_meta() { $author = sprintf( '<span><i class="x-icon-pencil"></i> %s</span>', get_the_author() ); if ( get_post_type() == 'x-portfolio' ) { if ( has_term( '', 'portfolio-category', NULL ) ) { $categories = get_the_terms( get_the_ID(), 'portfolio-category' ); $separator = ', '; $categories_output = ''; foreach ( $categories as $category ) { $categories_output .= '<a href="' . get_term_link( $category->slug, 'portfolio-category' ) . '" title="' . esc_attr( sprintf( __( "View all posts in: “%s”", '__x__' ), $category->name ) ) . '"><i class="x-icon-bookmark"></i> ' . $category->name . '</a>' . $separator; } $categories_list = sprintf( '<span>%s</span>', trim( $categories_output, $separator ) ); } else { $categories_list = ''; } } else { $categories = get_the_category(); $separator = ', '; $categories_output = ''; foreach ( $categories as $category ) { $categories_output .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in: “%s”", '__x__' ), $category->name ) ) . '"><i class="x-icon-bookmark"></i> ' . $category->name . '</a>' . $separator; } $categories_list = sprintf( '<span>%s</span>', trim( $categories_output, $separator ) ); } if ( comments_open() ) { $title = get_the_title(); $link = get_comments_link(); $number = get_comments_number(); if ( $number == 0 ) { $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments"></i> %3$s</a></span>', esc_url( $link ), esc_attr( sprintf( __( 'Leave a comment on: “%s”', '__x__' ), $title ) ), __( 'Leave a Comment' , '__x__' ) ); } else if ( $number == 1 ) { $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments"></i> %3$s</a></span>', esc_url( $link ), esc_attr( sprintf( __( 'Leave a comment on: “%s”', '__x__' ), $title ) ), $number . ' ' . __( 'Comment' , '__x__' ) ); } else { $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments"></i> %3$s</a></span>', esc_url( $link ), esc_attr( sprintf( __( 'Leave a comment on: “%s”', '__x__' ), $title ) ), $number . ' ' . __( 'Comments' , '__x__' ) ); } } else { $comments = ''; } $post_type = get_post_type(); $post_type_post = $post_type == 'post'; $post_type_portfolio = $post_type == 'x-portfolio'; $no_post_meta = x_get_option( 'x_blog_enable_post_meta' ) == 0; $no_portfolio_meta = x_get_option( 'x_portfolio_enable_post_meta' ) == 0; if ( $post_type_post && $no_post_meta || $post_type_portfolio && $no_portfolio_meta ) { return; } else { printf( '<p class="p-meta">%1$s%2$s%3$s%4$s</p>', $author, $date, $categories_list, $comments ); } }
It’ll remove date stamp from your site, so Google won’t crawl the dates in future. Please wait at least 72hrs to see the effect on search results.
Hope this helps, Cheers!
August 11, 2014 at 3:31 pm #82409Thanks,
I suppose I don’t mind doing it with a child theme… but isn’t there a way to do it with the parent?
I ask as we don’t actually intend on updating anything now that the site is finished and dialed in (unless we absolutely have to e.g. a security hole or similar).
Further, I don’t really mind having to re-add the above code should something happen such that we have to update the theme.
Let me know, if you would,
AJAugust 11, 2014 at 4:49 pm #82460Hey Aj,
You can add the above code directly to parent theme’s functions.php file. Path is /x/functions.php
Let us know how this goes!
August 18, 2014 at 3:12 pm #87088Hi,
This isn’t working either, unfortunately. Google has crawled the site each day since the code was implemented and is still showing the date in Search. Also, the code is adding the post’s date at the bottom-left of the footer on the front end (via document.write).
Any other suggestions?
AJ
August 19, 2014 at 12:18 am #87334Hi Aj,
Try to edit the file x/framework/functions/integrity.php directly
Then remove this code
$date = sprintf( '<span><time class="entry-date" datetime="%1$s"><i class="x-icon-calendar"></i> %2$s</time></span>', esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) );
Line number 27-30
Let us know how it goes.
Thanks
September 4, 2014 at 4:28 am #98242Would you mind consider adding this as a setting instead pls? It’s not very SEO friendly to show dates on pages and portfolios.
September 4, 2014 at 4:45 am #98248Thank you for your feature request.
We let our developers to know about it.September 22, 2014 at 8:55 am #109766+1 for removing date from Google results
September 22, 2014 at 8:56 am #109769Thank you for your input we will let our developers know.
September 22, 2014 at 2:58 pm #110110Date Exclusion SEO Plugin is working now, FYI.
September 22, 2014 at 5:33 pm #110208Nice to hear that Mark!
September 28, 2014 at 11:59 am #114210Hi,
Please make this as a feature in future updates, or has this been done already?
September 28, 2014 at 7:21 pm #114325Hi there,
Google author meta was removed, but not sure with date. I’m not sure if it will be implemented or not, date is one of blogging default feature.
But, I’ll forward your request 🙂
You can find something like this from x/framework/functions/{YOUR CHOSEN STACK}.php
$date = sprintf( '<span><time class="entry-date" datetime="%1$s"><i class="x-icon-calendar"></i> %2$s</time></span>', esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) );
And change to
$date = '';
Cheers!
-
AuthorPosts