Created
January 6, 2021 13:11
-
-
Save gerard-kanters/b6e7f01efa761339647204cb691375c6 to your computer and use it in GitHub Desktop.
Filter for Yoas SEO with Wordpress to index internal search pages. Add this in functions.php of your theme.
This file contains hidden or 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
//Let Google index search pages, otherwise following links will also stop | |
function index_search_robots ($robots) { | |
if ( is_search() ) { | |
return 'index,follow'; | |
} | |
return $robots; | |
} | |
add_filter( 'wpseo_robots', 'index_search_robots' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment