Site logo

[Resolved] Show updated post date only for visitors, not Google

Home Forums Support [Resolved] Show updated post date only for visitors, not Google

Home Forums Support Show updated post date only for visitors, not Google

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2466479
    Eber

    Hello,

    I would like to display the updated post date using Javascript, so that the dates wont appear on Google SERPs, but will for visitors.

    Do you think this code will work to achieve that?

    <script language=”javascript” type=”text/javascript”>document.write(“<?php the_time(‘F jS, Y’) ?>”);</script>

    If yes, how can I insert it on my theme, so that it shows below the post title?

    Thanks,

    #2466489
    Fernando
    Customer Support

    Hi Eber,

    I believe SERPs run javascript as well, so if you add the date through Javascript, it will see it regardless.

    So I think doing that wouldn’t work for your intended result.

    Here’s something I found though which may help: https://stackoverflow.com/questions/15685205/noindex-tag-for-google#:~:text=You%20can%20prevent%20Google%20from%20seeing%20portions%20of%20the%20page%20by%20putting%20those%20portions%20in%20iframes%20that%20are%20blocked%20by%20robots.txt.

    It may be good to ask an SEO expert regarding this as this would be out of our scope of expertise and support.

    You can use try adding the time along this way of “hiding” through a Hook Element. Hook it to generate_after_entry_title.

    #2466494
    Eber

    Thanks!

    #2466498
    Fernando
    Customer Support

    You’re welcome, Eber!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.