This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin name: Modification of robots.txt | |
* Version: 0.1.0 | |
*/ | |
/** | |
* Modify robots.txt for main site and english site | |
* | |
* @param $output | |
* @param $public | |
* | |
* @return string | |
*/ | |
function fbn_custom_robots( $output, $public ) { | |
$site_id = get_current_blog_id(); | |
if ( $site_id == 1 ) { | |
$output .= "Disallow: /agb-und-widerruf/n"; | |
$output .= "Disallow: /mein-konto/n"; | |
$output .= "Disallow: /warenkorb/n"; | |
$output .= "Disallow: /impressum-und-datenschutz/n"; | |
} elseif ( $site_id == 11 ) { | |
$output .= "Disallow: /account/n"; | |
$output .= "Disallow: /cart/n"; | |
$output .= "Disallow: /imprint/n"; | |
$output .= "Disallow: /terms/n"; | |
} | |
return $output; | |
} | |
add_filter( 'robots_txt', 'fbn_custom_robots', 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment