Created
December 5, 2019 12:17
-
-
Save deeman/cbae244e1ee27ce702b83a0adce055b9 to your computer and use it in GitHub Desktop.
NoIndex WooCommerce 'Order by' archives - via PHP
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
| // Woocommerce SEO — Noindex 'Order by' archives | |
| // Prevent indexing "Order by" | |
| add_action( 'wp_head', 'woo_prevent_indexing_orderby' ); | |
| if(!function_exists('woo_prevent_indexing_orderby')){ | |
| function woo_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