This article will benefit you for the rest of your life. I suggest you take a closer look. I have seen some articles about wordpress comments pagination which is not conducive to SEO over the past few days. Some Comments pagination is not recommended on the Internet. The following is a summary: the comment page leads to repeated titles under different links, repeated meta descriptions, and the same article content. disable
This article will benefit you for the rest of your life. I suggest you take a closer look. I have seen some articles about wordpress comments pagination which is not conducive to SEO over the past few days. Some Comments pagination is not recommended on the Internet. The following is a summary: the comment page leads to repeated titles under different links, repeated meta descriptions, and the same article content. disable
This article will benefit you for the rest of your life. I suggest you take a closer look.
I have seen some articles about wordpress comments pagination which is not conducive to SEO over the past few days. Some Comments pagination is not recommended on the Internet. The following is a summary: the comment page leads to repeated titles under different links, repeated meta descriptions, and the same article content.
If you do not enable the comments page, it will take me a long time. You know how long the comments are. so, you still need to split the pages. SEO also requires both drops. You can get both the fish and the bear's paw!
Solve the Problem of repeated titles
In your topic'sheader.php
Find similar code:
<? Phpglobal $ page, $ paged; wp_title ('|', true, 'right'); bloginfo ('name '); if ($ paged> = 2 | $ page> = 2) echo '| '. sprintf (_ ('page % s', 'xiaohudie '), max ($ paged, $ page);?>
Change
<? Phpglobal $ page, $ paged; wp_title ('|', true, 'right'); bloginfo ('name '); if ($ paged> = 2 | $ page> = 2) echo '| '. sprintf (_ ('page % s', 'xiaohudie '), max ($ paged, $ page); if (! Empty ($ cpage) // If the comment page is not the first echo '| '. sprintf (_ ('comment % s page', 'xiaohudie'), $ cpage);?>
Effect
Solve the Problem of repeated metadata descriptions
If your topic header label has the description function, you can add the following code at the end.
If ($ paged> = 2 | $ page> = 2) {$ description. = ': nth '. max ($ paged, $ page ). 'page';} if (! Empty ($ cpage) {$ description = sprintf ('% 2 $ s page of comment in % 1 $ s: ', get_the_title (), $ cpage ). $ description ;}
$description
You need to modify it according to the previous Code. If you do not have this function on the topic, go online and find relevant tutorials. This is not covered in this article.
This Code also solves the problem of duplicate homepage page titles.
Solve the same article content
There is a plug-in to implement this function: Paged Comments SEO, you can also directly throw the following code to functions. php
Function xiaohudie_seo_paged_comments ($ new_content = '') {if (! Empty ($ cpage) {remove_filter ('the _ content', 'xiaohudie _ seo_paged_comments '); // remove the original content $ new_content = sprintf ('the Page % 2 $ s you are commenting on % 1 $ s', get_the_title (), $ cpage ); $ new_content. ='
'. Mb_strimwidth (get_the_content (), 0,200 ).'
'; // $ New_content. ='
'. Get_the_excerpt ().'
'; // If your topic contains a truncated abstract or your article has a abstract, you can replace the previous line with this line.} return $ new_content;} add_filter ('the _ content ', 'xiaohudie _ seo_paged_comments ');
Effect
DEMO address: Give it to anyone. Here
Original article address: the wordpress Comment page is more conducive to SEO, thanks to the original author for sharing.