Title: Adding &#8220;Comments&#8221; to non-WordPress Pages
Last modified: August 18, 2016

---

# Adding “Comments” to non-WordPress Pages

 *  [benkeen](https://wordpress.org/support/users/benkeen/)
 * (@benkeen)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/)
 * Hi all,
 * First off, I LOVE WordPress. It’s been a breeze to install, configure and get
   running. Two very enthusiastic thumbs up. Fine family fun.
 * Anyway, I was wondering how you would go about adding the “comments” feature 
   to non-Wordpress pages. Is it possible? I’ve custom written a number of pages
   which are quite complicated as is; all I want it to tack on the Comments feature
   at the bottom to allow people to remark on the page content.
 * Any suggestions would be most appreciated! 🙂

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/page/2/?output_format=md)

 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-444770)
 * Convert your non-WP pages to WordPress [Pages](http://codex.wordpress.org/Pages)
   maybe? Then you can have comments.
 * Otherwise… no clue… can’t have a comment in WP without an associated Post/Page
   to hang it off of.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-444783)
 * Well, if you’ve got a few days (in other words, if you’re not on deadline….),
   I’ll write up what I did to make this sort of thing work.
 * But I won’t be able to get back to this until a week from today maybe.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-444792)
 * I know **_I_** would be rather interested to hear about it, vkaryl.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-444801)
 * Yah – I’ll post it here when I get back and get it into some sort of “might make
   sense” order. I had to do a really dirty hack to get it working right in an immediate
   sense (clients, y’know….), and I want to definitely try to get that part of it
   together without such a nasty workaround.
 * Will definitely be next week – I have the week from hell here beginning tomorrow
   at 0-dark-30.
 * In the meantime, you can see what I did for this particular client (including
   the extremely nasty hack) at [http://payrollemploymentgame.com/commentloop.php](http://payrollemploymentgame.com/commentloop.php)
 *  [kiralmarch](https://wordpress.org/support/users/kiralmarch/)
 * (@kiralmarch)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445037)
 * Yes, I am trying to do exactly the same thing! Everything else on my site runs
   off a mySQL DB, too, so I was planning to hack the comment function to allow 
   it to associate comments with another key.
 * Haven’t had time yet to dig through and figure out exactly how the comment functions
   work, though, so I’m curious to see/hear how someone else has done it. Thanks
   in advance!
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445038)
 * Y’know, I’m COMPLETELY embarrassed to say that I totally forgot to write this
   up. So I’m glad kiralmarch resurrected the thread. I’ve noted this on my paper
   planner and my PDA to-do list; I’ll try to get it together by the weekend.
 * Sorry!
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445039)
 * I can’t even reconstruct the ugly hack, since for some reason, I didn’t keep 
   a copy of the previous file.
 * What I finally wound up doing was simply to install an instance of wp in its 
   own subfolder after creating the database. Then on the commentloop.php page (
   which resides in site root), I input the following as the very first line of 
   the file (above even the doctype):
 * `<?php require('/home/username/public_html/wpfoldername/wp-blog-header.php');?
   >`
 * which means that any comments left through the page get saved to the database
   per normal, and display according to standard criteria in wp-options.
 * Had the client not been pushing for “instant”, I would no doubt have figured 
   that out first!
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445040)
 * … and just to be out of left-field, I recently found this nifty little thing:
   [http://js-kit.com/](http://js-kit.com/)
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445041)
 * Oh. Wow. Okay, you can come…. (and if you get THAT ref, you’re better than most….)
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445042)
 * Broken Arrow is about the only movie coming to mind. Am I close?
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445043)
 * Spot on! You’re only the second person in 10 years to get that….
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445044)
 * Loved that movie. 🙂
 * “When we have to go to war against Utah, we’re going to kick a**, ya know?”
 * I was living in Utah when I saw the movie, that line cracked me up pretty hard.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445045)
 * It cracks me up EVERY TIME I watch it – because I’m STILL living in Utah! “Scare
   the cows, wake the farmers….”, not to mention “Wow.” “Yeah. That was a first 
   for me too.”
 * I watch it several times a year – a guaranteed good time. Gonna have to find 
   a dvd one of these days….
 *  [kiralmarch](https://wordpress.org/support/users/kiralmarch/)
 * (@kiralmarch)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445046)
 * That js-kit.com thing would be great, except that I can’t get it to work with
   my dynamically generated URLs. Posted on the thread there, and no one has been
   able to help. 🙁
 * Vkaryl, thanks for posting your soln. I’m not sure I completely understand what
   you did, but I don’t think I want to do exactly the same thing. I want to put
   add/view comments on *many* non-wp pages on my site — a few thousand photo pages.
   I think it’s going to require hacking the post/comment ID system.
 * It looks possible, but I’ll probably break a bunch of stuff along the way. :-/
 * One problem: Without an associated ID in the wp_posts table, comments won’t be
   recognized as open so people won’t be able to make them. The best workaround 
   seems to be modifying the check for comment status in wp-comments-post.php so
   I can tell it to treat comments as open. (I think that’s better than adding dummy
   posts to the wp_posts table, and I don’t mind not being able to close comments
   on a post easily.)
 * Another (smaller) problem: In reading comments out of the DB, I’ll have to come
   up with an ID system for them that won’t interfere with the association of regular
   comments with wp_posts. Since it’s a numeric field, the only option I see is 
   to start at the max value for the field and count down, betting that it will 
   never meet my post count. (A good bet.) I can automatically assign that ID when
   I create each non-WP page.
 * Final problem: I’ll have to modify the comment_template function, since it looks
   up the post ID…I think I’ll have to feed it the post ID as a parameter and only
   let it look up if the parameter is null.
 * If anyone’s found a different way or has other thoughts, let me know!! Otherwise,
   I’ll tackle it this weekend, and let you know how it works out. Good thing it’s
   going to rain…
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/#post-445047)
 * Yes, please post back how it’s going. At this point, you might like to start 
   a new thread….

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/page/2/?output_format=md)

The topic ‘Adding “Comments” to non-WordPress Pages’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 16 replies
 * 4 participants
 * Last reply from: [kiralmarch](https://wordpress.org/support/users/kiralmarch/)
 * Last activity: [19 years, 4 months ago](https://wordpress.org/support/topic/adding-comments-to-non-wordpress-pages/page/2/#post-445049)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
