最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

categories - Remove WP Core canonical for category pagination

programmeradmin4浏览0评论

It seems that WP is adding a canonical to the root of my pagination, and no indexing all other pages on Category pages.

For example, /locations/residential/?_page=2 is no-index, and gives /locations/residential/ as canonical.

I have tried this to attempt to remove this for these Category pages, but Screaming Frog still says the pagination is no-index and rel=canonical to the root page.

add_filter( 'redirect_canonical','custom_disable_redirect_canonical' ); 
function custom_disable_redirect_canonical( $redirect_url ){
    if ( is_category() ) $redirect_url = false;
    return $redirect_url;
}

Any idea what I amdoing wrong?

发布评论

评论列表(0)

  1. 暂无评论