2

I can see the robots.txt file here :

http://persian.cc/robots.txt

But Google can't !

I know that I can find robots.txt files in the root of a website, but hey there is no robots.txt file in mine and this robots.txt is a virtual one being made by WordPress. Now how to stop wordpress doing that?

OR If I cannot stop wordpress showing that virtual robots.txt file, how can I stop Google looking for it on my website? maybe a .htaccess code or something?

j0k
  • 240
  • 4
  • 13
Parsa Pejvak
  • 31
  • 1
  • 4

1 Answers1

2

Two options:

  1. Create a static file robots.txt. Highly recommended.

  2. Filter 'robots_txt':

    add_filter( 'robots_txt', 'wpse_77969_robots' );
    
    function wpse_77969_robots()
    {
        status_header( 204 );
        return '';
    }
    
fuxia
  • 107,219
  • 39
  • 255
  • 462