Skip to content

Comment SEO Controls

SEOVault AI automatically optimizes comment links to prevent duplicate content issues and control how search engines crawl comment-related URLs. These improvements are enabled by default when the plugin is active.

Comment SEO controls address two issues:

  1. Duplicate content — WordPress creates unique URLs for each comment reply using ?replytocom= parameters, creating many nearly identical pages
  2. Link security — Comment reply links may pass SEO value without proper rel attributes

The plugin removes ?replytocom= parameters from comment reply links and redirects legacy URLs to clean versions.

Before:

https://yoursite.com/post/?replytocom=123

After:

https://yoursite.com/post/#comment-123

This change:

  • Eliminates duplicate content from comment reply URLs
  • Uses fragment anchors (#comment-123) for navigation
  • Redirects legacy URLs with a 301 status code
  • Preserves the ability to jump to specific comments

The plugin adds security and SEO attributes to comment reply links and comments popup links.

Default rel attributes:

  • nofollow — Prevents passing SEO value
  • noopener — Security measure for new windows
  • noreferrer — Privacy measure for referrer tracking

Example output:

<a href="https://yoursite.com/post/#comment-123" rel="nofollow noopener noreferrer">Reply</a>

The plugin filters comment reply links as they’re generated:

  1. Strips ?replytocom= from the href attribute
  2. Preserves the fragment anchor for navigation
  3. Merges rel attributes with existing ones (if any)
  4. Ensures no duplicate rel tokens

When a legacy ?replytocom= URL is requested:

  1. The plugin detects the parameter on template_redirect
  2. Validates the comment exists
  3. Removes the parameter from the URL
  4. Adds the fragment anchor (#comment-{id})
  5. Issues a 301 redirect to the clean URL
  6. Exits to prevent further processing

The redirect is skipped for:

  • Admin requests
  • Feed requests
  • AJAX requests
  • REST API requests
  • Cron jobs

To disable the removal of ?replytocom= parameters:

add_filter( 'seovault_remove_replytocom', '__return_false' );

This is not recommended as it allows duplicate content URLs to persist.

To change the rel attributes added to comment links:

add_filter( 'seovault_comment_reply_rel', function( $rel ) {
return 'nofollow'; // Only add nofollow
} );

You can also pass an array:

add_filter( 'seovault_comment_reply_rel', function( $rel ) {
return array( 'nofollow', 'noopener' );
} );

Common rel tokens:

  • nofollow — Don’t pass SEO value
  • noopener — Security for new windows
  • noreferrer — Privacy for referrer tracking
  • sponsored — Mark as sponsored link
  • ugc — User-generated content
  • Eliminates duplicate content — Search engines see one canonical URL per post instead of dozens of comment reply variations
  • Consolidates crawl budget — Search engines don’t waste resources on near-duplicate pages
  • Cleaner site architecture — Fewer URLs in search engine indexes
  • Prevents tabnabbingnoopener protects against malicious new window behavior
  • Privacy protectionnoreferrer prevents referrer information leakage
  • Cleaner URLs — Fragment anchors are more readable than query parameters
  • Backward compatibility — Legacy URLs still work via 301 redirects
  • Same functionality — Users can still jump to specific comments
  • You want to prevent duplicate content
  • You don’t need custom rel attributes
  • Your theme doesn’t conflict with the changes
  • You want to remove noreferrer for analytics
  • You need to add sponsored or ugc tokens
  • Your theme requires specific rel behavior
  • You have a custom comment system that requires the parameter
  • You’re debugging comment functionality (temporary)
  • Another plugin conflicts with the redirect

After enabling comment SEO controls:

  1. View a post with comments
  2. Check that reply links use #comment-{id} instead of ?replytocom=
  3. Test clicking a reply link — it should jump to the comment
  4. Try accessing a legacy ?replytocom= URL — it should redirect
  5. View page source and verify rel attributes on comment links