Missing robots_txt filter
-
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)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Missing robots_txt filter’ is closed to new replies.