WordPress Subscribe To Comments Plugin – Automatically Check Subscribe By Default
The Subscribe To Comments plugin is pretty popular among WordPress bloggers. For those that don't know, this plugin allows your readers to subscribe to specific posts and notifies them by email each time a new comment is placed. It's really a must for keeping your site visitors coming back and keeping them engaged in the discussion.
I'm in the process of launching a new site built on WordPress and installed version 2.1 which is the latest version of STC. I was a little disappointed to find that you can no longer automatically check the subscribe box by default. Here is what I found in the FAQ section of the readme.txt file that comes with the plugin.
= I'd like the subscription checkbox to be checked by default. Can I do that? =
Not anymore. But the checkbox status will be remembered on a per-user basis.
There is no real explanation of why the feature was removed. My guess is it was removed to cut down on spam complaints from users that comment, leave the subscribe box checked, and later complain that they are being spammed when they get notified of follow up comments. Personally, my goal isn't to send comment notifications to visitors that leave comments and don't care about follow up comments. BUT, I'd like to remove a step for those that do want to be notified by automatically checking the subscribe box.
I found a very simple "fix" for this issue. It involves a very easy modification to the plugin code.
1. Open subscribe-to comments.php
2. Find this code.
<?php /* ------------------------------------------------------------------- */ ?>
<?php /* This is the text that is displayed for users who are NOT subscribed */ ?>
<?php /* ------------------------------------------------------------------- */ ?>
<p <?php if ($sg_subscribe->clear_both) echo 'style="clear: both;" '; ?>class="subscribe-to-comments">
<input type="checkbox" name="subscribe" id="subscribe" value="subscribe"Â style="width: auto;" <?php if ( $checked_status ) echo 'checked="checked" '; ?>/>
<label for="subscribe"><?php echo $sg_subscribe->not_subscribed_text; ?></label>
</p>
<?php /* ------------------------------------------------------------------- */ ?>
3. All you need to do is add the word checked in the line shown below.
<input type="checkbox" name="subscribe" id="subscribe" value="subscribe"Â checked style="width: auto;" <?php if ( $checked_status ) echo 'checked="checked" '; ?>/>
4. Save and Upload the File
I've ran some tests on the plugin after the modification and it seems to work perfect. If anyone experiences some problems after the change, please let me know and I'll look into it.
Tags: plugins, subscribe to comments, wordpress
Mike Says:
I tried this but I couldn’t find the code. Apparently you’re doing it because your checkbox is checked…please help. Maybe you could email me the fixed plugin?
Brent Crouch Says:
Mike, open the file in a text editor and just search for this code.
input type=”checkbox” name=”subscribe”
It’ll put you exactly where you want to be.
Gilles (Objectifs Liberté) Says:
Thank you very much because i did not know how to change this and i have seen a lot of web sites who activate the checkbox by default.
I find you with google search “plugin subscribe to comment check subscription box by default”, chance you are on first page !
I made your modification and it perfectly worked.
Linas Matulis Says:
Thanks so much! It was so easy, clear and instantly effective. Took me 2 minutes to fix everything. And it’s REALLY VALUABLE. Best regards! 😉
Jay Says:
I use Subscribe To Comments plugin too, and I want default check. It is grat to find your article from google. It works. Thanks so much
Jay Says:
I have another question, I do not want “Subscribe without commenting “, like your website, how do i edit the subscribe-to comments.php