Jump to content

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

Recommended Posts

Posted

Site URL: https://noahlangphotography.com/blog/

I already have my meta data date turned off for all my posts, but how can the date be hidden from Google as well. It seems like a number of other people have the same question, but on different posts, so I thought I'd bring it up again.

This date in the image attached is what I'm referencing, and I think other people are too.

Thanks!

Screen Shot 2022-04-15 at 6.10.40 PM.png

Posted

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 the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Posted

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 the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

  • 4 months later...
Posted

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>

 

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.