elegant themes

Using WordPress comments as a contact form

| February 4, 2008 | 3 Comments

Justin Tadlock has posted a way to use built-in WordPress comments in lieu of a contact form. Basically, you replace your theme’s current comments.php file with the one that Justin offers for downloading that checks if a page is called “Contact.” If it is, the comments stay hidden on that page. You can change the comments.php file so that other pages on your site will also hide comments.

Then you can create your contact page which will display the comment form, but any comment submissions will stay hidden.

The advantages:

  • Don’t need to use another plugin
  • Don’t need to tweak a plugin
  • Can theoretically manage all contact form submissions from your site rather than via email.

The disadvantages:

  • Submissions are actually comments, so they end up in your comment queue. If you have a lot of comments on your site, that can get hard to manage.
  • if you ever change themes or your “comments.php” file, then your comments on your “Contact” page will no longer be private. This can be solved by deleting all of these types of comments, which I personally don’t like because I like to save letters from readers; or using this solution forever, which is kind of a long-term commitment.

It’s an interesting idea, and worth considering.

Even Simpler WordPress Contact Form

Tags: ,

Category: Tips


Comments (3)

Trackback URL | Comments RSS Feed

  1. [...] 60.   Why not setup your comments as a contact form? [...]

  2. Ryan says:

    Nice idea. I wouldn’t use it though in case I messed up and a bunch of private messages got published on my site.

    I think it would be a good idea to add the new comments.php file to your default theme too, even if you aren’t using it. This is because if your regular theme fails, WordPress seems to divert back to the default theme which would display all of your messages on screen.

    Couldn’t you put a regular contact form inside your theme anyway though? Or has that been done before?

  3. Norman says:

    Thanks a lot for this information, that what i was looking for to do in my blog but, I didn’t know what was the term for it. Well now i know and thanks for the tips.

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.

More in Tips (43 of 93 articles)