1

function noindex_comments_pages() { global $cpage; if (!empty($cpage) && $cpage > 1) { echo '<meta name="robots" content="noindex">'; echo "\n"; } } add_action( 'wp_head', 'noindex_comments_pages', 9 );


1

Just replace that snippet for this one: <?php $pages = paginate_comments_links(['echo' => false, 'type' => 'array']); if( is_array( $pages ) ) { $output = ''; foreach ($pages as $page) { $page = "\n<li>$page</li>\n"; if (strpos($page, ' current') !== false) $page = ...


1

The first thing to say would be, you can't say you haven't been warned - see codex page paginate_comments_links(), section »Defaults«: These arguments are mostly to make the call of paginate_links() work, so be careful if you change them. It's true, paginate_comments_links() is pretty much just a already customized version for comments of paginate_links()...


Only top voted, non community-wiki answers of a minimum length are eligible