【问题标题】:Woocommerce SEO -- Noindex 'Order by' archiveWoocommerce SEO——Noindex 'Order by' 存档
【发布时间】:2016-07-15 09:33:23
【问题描述】:

我在分类存档中遇到重复标题和重复元描述问题。

虽然其他子页面没有正确编入索引,但重复问题在 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 插件,我们如何从 Sorting 中不索引这些档案?

【问题讨论】:

    标签: wordpress woocommerce 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">';
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-13
      • 1970-01-01
      • 1970-01-01
      • 2011-06-28
      • 1970-01-01
      • 1970-01-01
      • 2015-02-26
      • 1970-01-01
      相关资源
      最近更新 更多