Skip to content

Instantly share code, notes, and snippets.

@deeman
Created April 23, 2018 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deeman/aee64671449c687a6ad4a88ff0bb272c to your computer and use it in GitHub Desktop.
Save deeman/aee64671449c687a6ad4a88ff0bb272c to your computer and use it in GitHub Desktop.
SEO & WooCommerce - Prevent indexing "Order by"
add_action( 'wp_head', 'cp_prevent_indexing_orderby' );
if(!function_exists('cp_prevent_indexing_orderby')){
function cp_prevent_indexing_orderby () {
if (isset($_GET['orderby'])){
echo '<meta name="robots" content="noindex, nofollow">';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment