v.7

Make sure your connection is secure ("httpS:" instead of just "http:"). Click the logo above for a secure connection.

| Menu ☰ |
× close
Home Products Services Blog Contact

CMSbyCW Demo CMSbyCW Tutorials / FAQs / Documentation CW Cyberspace Invaders (people liked it!) What's cooking?

What does "Unable to load comments." on a Page with a Comment Form mean?

What does "Unable to load comments." on a Page with a Comment Form mean?

Published on: 01/21/2026, 02:21 PM by Software Developer

This means that the File Path is wrong on the source code in the Comment Form itself. 

Out of the box, this should work if your CMS is installed directly under the public_html of your webhosting account. 

HOWEVER, if you decide to put it in another subfolder, filepaths ALSO change. 

I decided to blog about this, as in creating this CMS, I first started in a subfolder sandbox /sb/, and when it was stable, I moved to the main webhosting folder, under public_html. 

And OF course THINGS BROKE.  LOL!  

So, this is a "Note to self" , and also for those who would like to install in subfolders as well.  

I do it too.  

Like this post is now on the Main CMS Blog.  

But as you can see in the DEMO CMS, that is in the /demo/ subfolder.  

That's what Unit Testing, Regression Testing, and Quality Assurance Testing entails.  

Test it in different environments, before deployment.  

I already have completed the Quality Assurance Testing on the Package Itself (v7).  

I added features 

- Additional Sample Contact Form

- Additional Sample Comment Form

So I am basically doing the QA test all over again.  

I digressed.  

Here's how to make sure your Approved Comments Load and does not display "Unable to load comments.". 

Because if there's no comment yet, the message is "Be the first to comment."

So in the Post (or Page) where you have the Comment Form,

1) Click Edit Page (or post)

2) On the Content Box, select the "Source" Code tab

3) Hit Control + F (shortcut for Find), and then type   "loadComments" to go to the code block you need to tweak: 

  // ---------------------------
  // Load approved comments from JSON
  // ---------------------------
  function loadComments() {
    fetch(`/sb/data/comments_${postSlug}.json`)

4) Change the code, as in this example, by removing "/sb", so the new code should look like this: 

  // ---------------------------
  // Load approved comments from JSON
  // ---------------------------
  function loadComments() {
    fetch(`/data/comments_${postSlug}.json`)

5) Click the Update button.

6) Test the comment form on the front end by submitting a comment.

7) Go to your Dashboard

8) Click "Manage Comments"

9) Approve your test comment, so you can also check if your test comment displays on the front end.  

10) Nothing else should be done on the form itself.  These tips are just for when you see the "Unable to load comments."  

It simply means the "fetch" function is fetching from the wrong subfolder. :-)

Got feedback?

Click HERE and Leave a comment

Share:




Thank you for visiting our website!