Support » Plugins and Hacks » Hacks » block search engine from certain page using php script

  • 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 ………..

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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>&raquo; <a href="<?php bloginfo('url'); ?>"><?php _e('Or go to the homepage', 'default'); ?></a></p>
    	</div>
    </div>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘block search engine from certain page using php script’ is closed to new replies.