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.
What comment SEO controls do
Section titled “What comment SEO controls do”Comment SEO controls address two issues:
- Duplicate content — WordPress creates unique URLs for each comment reply using
?replytocom=parameters, creating many nearly identical pages - Link security — Comment reply links may pass SEO value without proper rel attributes
Remove replytocom parameters
Section titled “Remove replytocom parameters”The plugin removes ?replytocom= parameters from comment reply links and redirects legacy URLs to clean versions.
Before:
https://yoursite.com/post/?replytocom=123After:
https://yoursite.com/post/#comment-123This 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
Add rel attributes to comment links
Section titled “Add rel attributes to comment links”The plugin adds security and SEO attributes to comment reply links and comments popup links.
Default rel attributes:
nofollow— Prevents passing SEO valuenoopener— Security measure for new windowsnoreferrer— Privacy measure for referrer tracking
Example output:
<a href="https://yoursite.com/post/#comment-123" rel="nofollow noopener noreferrer">Reply</a>How it works
Section titled “How it works”Link modification
Section titled “Link modification”The plugin filters comment reply links as they’re generated:
- Strips
?replytocom=from the href attribute - Preserves the fragment anchor for navigation
- Merges rel attributes with existing ones (if any)
- Ensures no duplicate rel tokens
URL redirection
Section titled “URL redirection”When a legacy ?replytocom= URL is requested:
- The plugin detects the parameter on
template_redirect - Validates the comment exists
- Removes the parameter from the URL
- Adds the fragment anchor (
#comment-{id}) - Issues a 301 redirect to the clean URL
- Exits to prevent further processing
The redirect is skipped for:
- Admin requests
- Feed requests
- AJAX requests
- REST API requests
- Cron jobs
Customization
Section titled “Customization”Disable replytocom removal
Section titled “Disable replytocom removal”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.
Customize rel attributes
Section titled “Customize rel attributes”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 valuenoopener— Security for new windowsnoreferrer— Privacy for referrer trackingsponsored— Mark as sponsored linkugc— User-generated content
Benefits
Section titled “Benefits”SEO benefits
Section titled “SEO benefits”- 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
Security benefits
Section titled “Security benefits”- Prevents tabnabbing —
noopenerprotects against malicious new window behavior - Privacy protection —
noreferrerprevents referrer information leakage
User experience
Section titled “User experience”- 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
When to customize
Section titled “When to customize”Keep default settings if:
Section titled “Keep default settings if:”- You want to prevent duplicate content
- You don’t need custom rel attributes
- Your theme doesn’t conflict with the changes
Customize rel attributes if:
Section titled “Customize rel attributes if:”- You want to remove
noreferrerfor analytics - You need to add
sponsoredorugctokens - Your theme requires specific rel behavior
Disable replytocom removal if:
Section titled “Disable replytocom removal if:”- You have a custom comment system that requires the parameter
- You’re debugging comment functionality (temporary)
- Another plugin conflicts with the redirect
Testing
Section titled “Testing”After enabling comment SEO controls:
- View a post with comments
- Check that reply links use
#comment-{id}instead of?replytocom= - Test clicking a reply link — it should jump to the comment
- Try accessing a legacy
?replytocom=URL — it should redirect - View page source and verify rel attributes on comment links