• Hi,

    I propose changing the do_robots function to get the robots_txt filter back like this:

    function do_robots() {
    		remove_action( 'do_robots', 'do_robots' );
    
    		header( 'Content-Type: text/plain; charset=utf-8' );
    
    		do_action( 'do_robotstxt' );
    
    		$output = "User-agent: *\n";
    		$public = get_option( 'blog_public' );
    		if ( '1' != $public ) {
    			$output .= "Disallow: /\n";
    		} else {
    			$output .= "Disallow:\n";
    			$output .= "Disallow: /wp-admin\n";
    			$output .= "Disallow: /wp-includes\n";
    			$output .= "Disallow: /wp-login.php\n";
    			$output .= "Disallow: /wp-content/plugins\n";
    			$output .= "Disallow: /wp-content/cache\n";
    			$output .= "Disallow: /wp-content/themes\n";
    			$output .= "Disallow: /trackback\n";
    			$output .= "Disallow: /comments\n";
    		}
    
    	      echo apply_filters('robots_txt', $output, $public);
    	}

    Cheers ??

    https://www.ads-software.com/extend/plugins/network-privacy/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ron Rennick

    (@wpmuguru)

    Could you clarify what you mean by changing … back ?

    Oh, right… I’ve no idea how long this filter hook has been available in WordPress so it might not be a case of ‘back’ in that sense.

    It’s just that I’m working on an XML Sitemap plugin that uses that filter for allowing additional rules (pretty much similar to those Network Privacy is adding) which suddenly and to my surprise did not work anymore… until I found out that it was Network Privacy that was hogging the whole do_robots thing ??

    Hence my request ??

    Plugin Author Ron Rennick

    (@wpmuguru)

    Could you email me a reminder? I’m currently working on finishing up domain mapping for 3.5 installed in its own folder. I’ll lose track of this thread due to the volume of posts that comes through my feed.

    Same here… terribly busy… but I’ll add it to the plugin todo list and hopefully get back to it soon.

    Meanwhile, I hope your famous domain mapping plugin development is going smoothly ??

    Plugin Author Ron Rennick

    (@wpmuguru)

    If I get another hour this weekend I should have a dev version ready for testing ??

    Hi Ron, did you ever get around to the dev version? Let me know and I’ll be happy to test it ??

    Plugin Author Ron Rennick

    (@wpmuguru)

    @ravanh – no, I’ve been sick, have moved, trying to sell a house, etc. so I’ve had almost no time to look at anything.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Missing robots_txt filter’ is closed to new replies.