I want to create a page that can not be visited by search engine bots, but I just want to use php script to block it, is there anything that can help me ...........
I want to create a page that can not be visited by search engine bots, but I just want to use php script to block it, is there anything that can help me ...........
using this code in the loop like:
if (is_page()) {
$something = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/google/i', $something)) {
wp_redirect(home_url('/'));
}
}
thank's mcjambi
but I don't know how to apply on my 404 page, this is my 404 page:
<div class="hentry post 404">
<h1><?php _e('Not Found', 'default'); ?></h1>
<div class="entry">
<p><?php _e('Apologies, but we were unable to find what you were looking for. Perhaps searching will help.', 'default'); ?></p>
<?php get_search_form(); ?>
<p>» <a href="<?php bloginfo('url'); ?>"><?php _e('Or go to the homepage', 'default'); ?></a></p>
</div>
</div>You must log in to post.