2016-07-15 7 views
0

私は重複したタイトルを持っています&重複したメタの説明は、カテゴリのアーカイブのソートの問題です。Woocommerce SEO - Noindex 'Order by'アーカイブ

他のサブページは正しくインデックス付けされていませんが、重複した問題は次のパターンの1番目に表示されます。

/product-category/name/ 
/product-category/name/?orderby=dat 
/product-category/name/?orderby=menu_order 
/product-category/name/?orderby=price-desc 
/product-category/name/?orderby=price 

私はYoast SEOプラグインを使用していますが、どのようにこれらのアーカイブをソートしてもいいですか?

答えて

1

あなたのfunctions.phpにこのコードを使用し

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">'; 
     } 
    } 
} 
+0

ありがとうございます。それは動作します:) – tushonline