Created
November 5, 2019 14:04
Star
You must be signed in to star a gist
Filter robots.txt file with SEOPress PRO
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
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