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
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?
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.
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.