Jump to content

How to hide date from Google Search results, not meta data?

Recommended Posts

If SS is outputting the date to the page from the backend then the horse is out of the barn ( it is basically to late ). We can't alter the backend, only SS can.

Anything we could do client side may make no difference. Hiding is via CSS or removing it with JavaScript, the search engine crawlers may choose to honor or ignore. And if it is ignored then you're out of luck.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment

I'm not a search engine crawler expert but I'm dubious to the success of doing anything client side with CSS or JavaScript.

If anyone knows different please chime in!

No guarantees but the first thing you could try would be hiding the date with CSS. Again this doesn't remove it from the page but hides it visually.. The second thing would be to remove the elements with JavaScript. Whether each SEC will honor those changes is, I think, questionable.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment
  • 4 months later...

After working with Will Meyers on this one, he thankfully found the solution, and I tested it to make sure it works. This even works if your posts have already been indexed. You can submit them again, and the dates will be removed.

https://www.will-myers.com/articles/hide-blog-post-dates-from-google-results-page

<script>
  /**
   * Remove Blog Post Dates From SERP
   * From Will-Myers.com
  **/
  function removeDates() {
    let metaPublished = document.querySelector('head meta[itemprop="datePublished"]');
    if (metaPublished) metaPublished.remove();

    let metaModified = document.querySelector('head meta[itemprop="dateModified"]');
    if (metaModified) metaModified.remove();

    let datePublished = document.querySelector('time.dt-published');
    if (datePublished) datePublished.remove();
  }
  removeDates()
  window.addEventListener('DOMContentLoaded', removeDates)
</script>

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.