Self-Hosted Commento vs Built-In WordPress Comments

Since I have gotten my performance in order on this website. I decided to get the comments in order and thought at first that I would go with Disqus but quickly was discouraged when I saw they automatically add affiliate links and ads to your website. No thanks! You are able to turn off the affiliate links but there are other reasons to consider, Commento:

Pros

  • Responsive (ONLY 11 KB of JavaScript and CSS)
  • Privacy-focused
  • Social Logins (Google, Twitter, GitHub & GitLab)
  • Hosted ($5 and up) OR Self-hosted
  • Less load on your sever
  • Docker Support
  • More features vs built-in WordPress Comments
  • Embed comment forms anywhere with tiny HTML script
  • Mobile-responsive
  • Analytics

Cons

  • No WordPress Plug-in
  • Something else to manage (if you choose to self-host)
  • Setup (if you choose to self-host)
  • No Native SSL Support (requires extra work to add-on)

One other really awesome thing about Commento is that you are given the choice to either pay to have it hosted Commento.io or host it yourself!

If you decided to have them host it for you or self-host, either way, you can import comments from Disqus into Commento. So right now, if you're coming from WP comments, you may need to import your WordPress comments into Disqus first and, then export your comments, etc.

Commento + Docker + SSL

I found an awesome repository for getting up and running with self-hosting, Commento. Raul uses Let’s Encrypt for SSL/TLS, along with NGINX.

GitHub: Commento easy-install with Docker Compose and SSL

I had trouble getting NGIX to properly load the SSL certificate files and found I had to change the permission of both files to:

sudo chmod 0640 /etc/letsencrypt/live/commento.mydomain.com/fullchain.pem
sudo chmod 0640 /etc/letsencrypt/live/commento.mydomain.com/privkey.pem

That got me up and running.

Place the code

<script defer src="https://commento.mydomain.com/js/commento.js"></script>
<div id="commento"></div>

Getting It Working With a Child Theme

I duplicated content-single.php into my child theme directory (GeneratePress) and pasted the Commento code right after this line:

</div><!-- .inside-article -->

INSERT YOUR CODE HERE

</article><!-- #post-## -->

This puts the comment form on only your post pages.

Final Thoughts

I had a little snafu with receiving the confirmation e-mail once I had setup Commento and there wasn't an option to request another to confirm my e-mail so I had to reset the docker containers.

I removed the restart parameter from the docker config file and ran the commend, docker-compose down to shut them down politely. Then, docker volume prune to delete all the Docker volumes on the server and last docker-compose up –build.