1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

remove date for serps but show it to visitors

Discussion in 'HTML & Website Design' started by aspire, Jan 4, 2017.

  1. #1
    On this site, gilbertconstruct(dot)com

    I want to remove the dates from all the posts so that it is not visible to se bots while continue to show it to users in this format - Last updated: Jan 5, 2017

    I located this plugin that removes the dates
    https://wordpress.org/plugins/wp-old-post-date-remover/

    And also located a way to put in the dates though javascript
    http://www.andrewkeir.com/remove-wordpress-post-datestamp-timestamp-google-serps/

    But couldn't figure out the appropriate files and areas where these changes need to be effected.

    To sum up, I want to show the last updated date of the post to the visitors without showing it to the search engine bots.

    If anyone can help with this...

    Thanks
    aspire
     
    aspire, Jan 4, 2017 IP
  2. hdewantara

    hdewantara Well-Known Member

    Messages:
    536
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #2
    Those dates on your site appear like this element:
    <span class="posted-on"><a href="http://www.gilbertconstruct.com/pros-and-cons-of-concrete-flooring/" title="3:54 am" rel="bookmark"><i class="fa fa-calendar-o"></i> <time class="entry-date published" datetime="2017-01-03T03:54:11+00:00">January 3, 2017</time></a></span>
    HTML:
    and my guess is neither CSS nor javascript plugins could hide them from search-engines. Perhaps you should consult your "colormag" theme developer for this custom feature?
     
    hdewantara, Jan 4, 2017 IP
  3. aspire

    aspire Well-Known Member

    Messages:
    4,003
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    175
    #3
    I checked with them and this is what they said
    "
    If you want to update the code in widgets then you need to edit the inc/widgets/widgets.php file and if you want to edit the posted time in archive,single,search pages then you need to edit inc/functions.php file and need to find the function named colormag_entry_meta.
    "

    But I couldn't find such mentioned function in the functions.php file.
     
    aspire, Jan 4, 2017 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,494
    Likes Received:
    4,457
    Best Answers:
    123
    Trophy Points:
    665
    #4
    You won't be able to do it for all the bots but you are probably only interested in Google and Bing anyway.
    Create a function to check if the $_SERVER['HTTP_USER_AGENT'] is in your list of bot user agents or has a matching substring. If it isn't, then echo out the date.

    You can get really fancy and create a plugin that allows you to update the user agent matching strings but you really just need a function that returns true or false.
     
    sarahk, Jan 5, 2017 IP
  5. aspire

    aspire Well-Known Member

    Messages:
    4,003
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    175
    #5
    Ok. I will try this out and keep the thread posted how this worked out for me. Thanks !
     
    aspire, Jan 5, 2017 IP