Skip to content

Instantly share code, notes, and snippets.

@wp-seopress
Created November 5, 2019 14:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save wp-seopress/04dd6df1b618c7ace16e0296f60a4575 to your computer and use it in GitHub Desktop.
Filter robots.txt file with SEOPress PRO
add_filter('seopress_robots_txt_file','sp_robots_txt_file');
function sp_robots_txt_file($html) {
//eg for Polylang and multidomain option enabled
if (function_exists('pll_current_language') && pll_current_language() =='en') {
$html = 'my custom rules here for english domain';
} else {
$html = 'my custom rules here for default case';
}
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment