Restricting comments to paid subscribers

I’m using the Lyra theme on Ghost Pro - and I’m thinking about integrating with Disqus to add a comments section to my posts. I’d like to know if its possible to restrict comments to paying subscribers.

I think this would be useful for a couple of reasons: it may cut down on abusive comments, which I guess are more likely to come from people who don’t wish to pay! And it offers added value to subscribers too.

Andrew

1 Like

You can restrict who can see comments on your site pretty easily, but Disqus also publishes all comments to its own site - so they won’t be private. This is a Disqus thing, rather than a Ghost thing, and can’t be changed as far as I’m aware.

A better solution for full private members-only comments for Ghost would be https://cove.chat - which is what I use for this exact usecase.

2 Likes

Thanks, I’ll give this a try!

Andrew

I’ve now set up Cove - but it shows and allows comments for any subscribed member, not paid members only. Is there any way of tweaking it so that only paying subscribers can post comments?

Andrew

1 Like

Sure! I do it like this:

{{#if @member.paid}}
        <div id="cove"></div>
        <script>
        const Cove = {
        publication: "yourpublicationIDgoeshere",
        contentId: "{{id}}",
        memberId: "{{@member.uuid}}",
        memberEmail: "{{@member.email}}"
        }
        </script>
        <div></div>
{{/if}}
2 Likes

Thanks!

It’s working fine now.

Andrew

Thanks for sharing Cove, John :raised_hands: And for helping Andrew. Glad you got it sorted @aclifton777!

2 Likes

Thanks for sharing this! A related Cove question - is there a way to make comments visible to all but restrict the commenting function to paid members only?

1 Like

Hi Kat. I just added this feature!

Add the following two lines:

requirePaid: true,
isPaid: {{@member.paid}}

for example:

<script>
  const Cove = {
    publication: "your_site_id",
    contentId: "{{id}}",
    memberId: "{{@member.uuid}}",
    memberEmail: "{{@member.email}}",
    requirePaid: true,
    isPaid: {{@member.paid}}
  }
</script>

CC @John @aclifton777

1 Like

Thanks, Dan! Unfortunately what is happening when I add that code is paid and free members can see their login info but the comments and commenting field don’t show up for either.

Of course, there is a high likelihood I have made an error. Below is what I have in comments.hbs (without your additional lines) - note I’ve removed the login form. This shows comments and the commenting field/button to all members. When I add the two lines, they disappear. (Screenshots below as well.)

For reference, there are a couple of goals here: one, offer another incentive for readers to pay for membership; and two, limit spam/abuse (and the need for moderation).

If I use John’s code above, only paid members can even see the existence of comments, which is great except that it doesn’t offer much of an incentive to join as people don’t even know they’re there. If I change line 3 below to {{#if @member.paid}}, only paid members see the comments/can comment and free members and those not logged in see the upsell, which is the best option I can see so far but again, isn’t a huge incentive.

Thanks for any insight you can offer!

1 Like

Hi Kat,

The code below is a stripped down version of the default install code from Cove, plus the two new lines that only let paid members leave comments. It displays comments to everyone, even signed-out users.

{{#if @labs.members}}
  <h2><span id="cove-count"></span> Comments</h2>

  {{^if @member}}
    <p>Sign in or become a {{@site.title}} member to join the conversation.</p>
    {{!-- The default install code has a sign up form here too --}}
  {{/if}}

  <div id="cove"></div>

  {{#if @member}}
    <p>Signed in as {{@member.email}} · <a href="javascript:" data-members-signout>Sign out</a></p>
  {{/if}}

  <script>
  const Cove = {
    publication: "5a18db3e75ef5bbfcaa5e6f4ed61f740",
    contentId: "{{id}}",
    memberId: "{{@member.uuid}}",
    memberEmail: "{{@member.email}}",
    requirePaid: true,
    isPaid: {{@member.paid}}
  }
  </script>
{{/if}}

Please try that and let me know how it goes!

-Dan

1 Like

Thanks, Dan! I’ve tested that and it is working for unpaid members - they get the comments and the copy “Leaving comments is currently only enabled for paying members.” with no form - but when not logged in, all I see is the copy in line 4. Let me know if you want to get on email and I can give you more details or site access. Or if this is completely unimportant to your business, don’t worry about it - I can live with this solution!

I want to restrict comments only to paid members, but I want to show them to anyone. I’m using a self-hosted version of Commento.

Does anyone knows what kind of code I need to do this?

Thanks

@xune you should be fine as long as you leave the DIV-tag for displaying the comments outside the handlebar for access and keep the script inside the handlebar.

I don’t use Commento and I don’t know what theme you’re using, so I don’t know what your comment.hbs template looks like.

Hi, I’m using the Dawn Theme. Here’s my code.

{{#if @member.paid}}
<div class="comment container small">
<h2>Comments</h2>
<script defer src="https://commento.mysite.com/js/commento.js"></script>
<div id="commento"></div>
</div>
{{/if}}

Should be enough to move the div tag with the commento to be outside the if.

I tried moving the div outside the if, and restarting Ghost, but nothing is showing for non members

I’ll post how I would do it a bit later.

@xune try this (not tested):

<div class="comment container small">
<h2>Comments</h2>
{{#if @member.paid}}
<script defer src="https://commento.mysite.com/js/commento.js"></script>
{{/if}}
<div id="commento"></div>
</div>

hi, just tried and unfortunately non-members can’t see the comments