Jump to content

Hiding text from search engine


fri3ndly

Recommended Posts

Hello

 

I have this code:

 

<body>
<div id="wrapper">
<div id="header-bar"><?php echo date("j M Y | H:i:s"); ?></div>
<div id="header">
	<div id="logo">
	  <h1>Website Title<h1>

 

When the search engines index this site, the date of the index will also be indexed and will display as the text for the website description.

 

Is there a way either with PHP or CSS to stop search engines reading what is in 'header-bar'?

Link to comment
https://forums.phpfreaks.com/topic/93704-hiding-text-from-search-engine/
Share on other sites

a robot is like an automatic browser, so it downloads the page to client side (probably another process searches it later), so what you have to do is recognise that it's a bot and just not serve it up to it. Have a look at $_SERVER['HTTP_USER_AGENT'], then regex it against some rules for detecting bot's... or some people check against ip ranges...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.