-1

So I can reply to comments on local but it doesn't work on live. I can reply via the admin panel but when I click reply on a comment on a single page, it doesn't work.

I checked the code and it seems like the href of the reply button is rendered differently.

This is how it looks on localhost

<a rel="nofollow" class="comment-reply-link" href="http://localhost:8888/foobar/?replytocom=1285#respond" data-commentid="1285" data-postid="7086" data-belowelement="comment-1285" data-respondelement="respond" data-replyto="Reply to foobar" aria-label="Reply to arsd">Reply</a>

This is how it looks on production

<a rel="nofollow" class="comment-reply-link" href="#comment-1285" data-commentid="1285" data-postid="7086" data-belowelement="comment-1285" data-respondelement="respond" data-replyto="Reply to Alex Kwa" aria-label="Reply to foobar">Reply</a>

I'm thinking it could be either a plugin, permalink or htaccess issue.

  • I don't have any plugins that touches the comments.
  • My permalink is custom but where possible I would like not to change it due to SEO impact.
  • My htaccess looks like this
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] 

<ifModule mod_headers.c>
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

SetEnv MAGICK_THREAD_LIMIT 1
 

Any help will be much appreiciated.

  • I don't see how this could have anything to do with .htaccess? – MrWhite Sep 4 at 19:06
  • HTAccess has nothing to do with rendered HTML, there is no way for the two to influence each other, it is completely unrelated with zero overlap. To debug this we would need to see the PHP code that generates the comment reply link HTML – Tom J Nowell Sep 4 at 23:52
0

I know I stated that it doesn't seem like a plugin issue, but I've found the problem is actually with a plugin, Yoast SEO. A similar issue can be found here.

I've fixed it by disabling the specific function that replaces replytocom to comment by including this into my function.php

add_filter( 'wpseo_remove_reply_to_com', '__return_false' );

Note that this does not solve the issue, but according to Yoast SEO, it's a problem with themes that scroll you to the comment input form upon a reply so they won't be fixing it on their end.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.