AJAX Comment Preview


Get the plugin from the Ajax Comment Preview page in the WordPress.org plugins directory.


The newest version of this plugin (version 2.1) is compatible with WordPress 2.6 and higher only. Users of WordPress 2.0.x should use the older version 1.0.1 (which is unsupported and probably broken).


For more information, see the Ajax Comment Preview FAQ in the WordPress.org plugins directory.

To use this plugin, all files from the zip file you download must be in your wp-content/plugins/ directory. If you choose to place them in a subdirectory, all files must be in the same directory.

Activate the plugin from your WordPress site’s Plugins admin page.

Edit the plugin’s options from your Options -> AJAX Comment Preview admin page in order to specify the formatting of the preview. This will depend on your particular theme. The default format works for WordPress’ default Kubrick theme.

Note: You may need to tweak your theme’s CSS to get the preview to look exactly like a normal comment.


I get a number of comments on this post testing the system. A little odd, since it seems to me people should be testing the preview functionality (which is new) not the comment posting functionality (which is the same old WordPress standard stuff). Anyway, that’s cool. Go ahead. But please do me a favor; don’t just thow up some lame “testing” comment. Try sending over a poem or maybe something from the Farmer’s Almanac. Tell me your favorite book/artist/music. Don’t suck; try to be creative.

The History

My original post.


  • Fixes an JavaScript issue in Internet Explorer reported by Eric


  • Full gravatar/avatar support
  • Moved to jQuery
  • WordPress 2.7 support
  • Should have fixed any character endcoding issues
  • Should now work on pages served as XML


  • Fully internationalized dates


  • Fixed some JS errors (Mark Jaquith)
  • %email_hash% available for gravatars
  • Readme file with configuration instructions
  • Fix double offset in dates (Mark Jaquith)


    tami 12.06.2008 @ 17:41

    hi – this isn’t working for me in Firefox.

    works fine in IE and is GREAT!

    but for some reason it doesn’t work at all in Firefox… anyone else have this problem?

    works here on this site in FF but not in our site… what am i doing wrong?

    test 12.14.2008 @ 14:48


    Jeremy 12.15.2008 @ 11:45

    Great plugin – best one I’ve seen for comment preview. I use it on both of my blogs (personal and professional). However I just saw 2.0 show up on wordpress.org and it doesn’t seem to work. Started investigating but didn’t figure it out yet – I’ll let you know if I have time to figure out why it broke for my blog. I didn’t see a changelog but from the code it looks like you did some major rewriting… (e.g. jQuery) – any known bugs? Anyone else having problems?

    Mariano 12.16.2008 @ 18:22

    Works fine in worpress 2.7

    The only question for me is, how can I configure the preview button to get the same appeareance that the “submit comment” one?

      scribu 01.01.2009 @ 19:06

      You can use the #acp-preview CSS selector.

    scribu 01.01.2009 @ 19:08

    Hello! Just installed your plugin and it’s working great.

    Just have one minor problem: Could you add around Says, so it matches the default comment template in WP 2.7?

    Eric 01.27.2009 @ 11:33

    Why is there a
    version=”1.0″ encoding=”utf-8″ message in the preview box with IE 7 and ajax preview plugin v2.0 (I’ve just checked out on this site)???

      MDA 01.29.2009 @ 20:29

      Version 2.1 should fix this. Thanks!

    Abel Cheung 02.14.2009 @ 11:52

    Probably I run into some obscure problem(?): typing some specific pattern and the whole comment preview will be gone. To test it, one can type these keys in sequence:

    [e] [c] [h] [o] [space] [a] [;]

    The most important things are “echo” and semicolon. “a” can be replaced by anything. This can be problematic when pasting code snippets in comment.

      MDA 02.14.2009 @ 18:16

      It’s not a problem with the plugin, it’s a problem with my server.

      My host has mod_security installed on my webserver, which is blocking that request. You’ll note that if you try to post a comment with the same text, you get a 412 Precondition Failed error.

      So the plugin really is returning the same result back to you when you preview the comment as WordPress would after submitting the comment for real.

    exer 02.22.2009 @ 14:52

    Thanks for the plugin, it’s working flawlessly!

    aa 02.26.2009 @ 02:56

    Thanks for the plugin…

    wa7di 02.26.2009 @ 02:57

    Umm… the plugin is amazing! and original. I really liked it, and it worked when I used it.
    However, when I installed the MCEComments plugin, it stopped working. When I click, it doesn’t preview the comment.
    Is there someway to make it compatible with that plugin?

    Thanks a lot!

    docwhat 03.08.2009 @ 09:28


    Some conflict or are obsoleted by other suggestions. I’m just trying
    to offer alternatives.

    Use JavaScript to insert the preview button and #ajax-comment-preview. This wil prevent
    it from “not working” if a user doesn’t have JavaScript enabled (or
    something goes wrong).
    Move the preview button into the that contains the submit
    comment button. Either via add_filter() in php or via JS if you use
    the above suggestion.
    Have an option (as the default) to just use the system default for
    the date string instead of specifying it.
    Have an option to use the wp_list_comments() default markup. It
    should probably also be the default. This way a user won’t have to
    update this as things change.
    Maybe a “restore default” button for things?

    xx 03.14.2009 @ 20:09


    Domus 03.28.2009 @ 07:18

    Хороший плагин! Спасибо большое! Искал нечто подобное более 2-х лет и никак не мог найти…

    Mia 04.05.2009 @ 05:10


    Druzhanja 04.05.2009 @ 13:36

    Прикольный плагин, а он и переводит коментарии??

    aldren 04.23.2009 @ 07:53

    thanks for the plugin! ^^

    bas 04.29.2009 @ 13:49

    Damn great plugin!
    Thanks a lot!!!!!!!!!!!

    Ben 05.02.2009 @ 15:08

    Great Stuff!

    caillou 05.16.2009 @ 01:04

    thank so much

    Darren 05.25.2009 @ 19:53

    Great plugin

    ivan 05.28.2009 @ 20:25

    great plugin!

    albert 05.29.2009 @ 13:57

    I am testing your comment pluging right now.

    igoy cavalera 05.30.2009 @ 13:30

    good job! i loved! thanks brother

    William 05.30.2009 @ 18:45

    I was researching a number of comment plugins when I came across this one. I really like the idea of adding the preview function. Thanks.

    “It is best to do things systematically, since we are only human, and disorder is our worst enemy.” Hesiod (~800 BC)

    Pablo Almeida 06.10.2009 @ 18:07

    Nice plugin! Congratulations! ;)

    Kevin Paquet 06.12.2009 @ 15:31

    Just leaving a comment to see whether I can also leave comments without refreshing the page.

    refe 06.19.2009 @ 13:16

    What’s the best way to change the way the button itself looks? I want to integrate it more fully with the visual style of my site.


    Slob Jones 06.19.2009 @ 17:28

    Good functionality, but almost impossible to style.

    This thing won’t be viable until it incorporates wp_list_comments.

    Further, I don’t see any way to position the Preview button. I want it to the left of my Submit button, but that’s set in the comments form within comments.php.

    I hope you’ll update this plugin!

    Josh 07.10.2009 @ 12:12

    Any plans to make this plugin compatible with WordPress 2.8? Love it and would use it frequently!

    sandrella 07.19.2009 @ 13:50

    Nice Post !

    Please Visit My Blog:
    New Release hot Entertainment & movie story !!!

    Thank !


    OK, here goes on the creativity front as per your instruction….have you heard of Rock Dust? It transpires that finely powdered volcanic rock is a very effective organic fertlizer, duplicating natural processes in boosting your soils mineral base. Remineralising the earth is a sure fire means to capture more carbon, and ultimately averting climate change. I hope this gave you some farming perspective, as per your request.

    On a more serious note – WordPress ROCKS!

    Scotty Cline 07.28.2009 @ 07:33

    Can’t wait to get this fully implemented in my site. Thanks.

    unfaike 08.01.2009 @ 15:37

    As so xxl club casino .a search .take us .lake tahoe hotel and casino Heh, As so aqueduct race track casino practice casino games whether or no Get info on sirenis cocotal beach resort casino u0026 spa punta cana stanleys casino liverpool take us locations in casino royale the casino brawl comanche red river casino This website about cuban casino chips .

    erer 08.17.2009 @ 21:26


    hfgh 08.30.2009 @ 14:50

    Now compatible with WP AJAX Edit Comments plugin, which lets you moderate comments posted using AJAX:

    Karl Foxley 09.02.2009 @ 16:01

    This is a really cool plugin and I’ve installed it on a couple of my blogs.

    Thanks for sharing,


    patou 09.13.2009 @ 08:40

    Thanks ! and happy new Year !

    Coapscerroste 10.04.2009 @ 01:30

    He who asks is a fool for five minutes, but he who does not ask remains a fool forever.

    sadasda 10.12.2009 @ 02:27

    한글도 들어갑니다.

    Dave 10.12.2009 @ 09:40

    where can I fine 2.1

    aditia.numberone 10.27.2009 @ 23:21

    i have problem with ajax comment preview, my jQuery scrollto is not work if i use this

    chudak 10.29.2009 @ 03:27

    I’m the designer :)

    Nokia Themes 10.31.2009 @ 03:08

    Nice preview. This is really looking good and I am using it to one 1 of my blogs

    Anders Holm 11.01.2009 @ 03:15

    Yet another reason to update your WP blog to a newer version (2.6+)!

    Kim Kirkpatrick 11.04.2009 @ 21:41

    It’s really too much trouble to do this; a true “code” tag is needed, one that would do a truly literal block quote, preserving initial space, special characters without interpretation, etc. But the preview at least makes it possible to fine-tune. Had to construct this in an editor for replacing stuff; had to use use ‍ to disconnect the %’s from %‍content%, etc.

    This is a wonderful plugin; should be in the core.

    class Ajax_Comment_Preview {
      function version() { return '2.0'; }
      function init() {
        add_option( 'ajax_comment_preview', array('template' => <<<EOM
        <ul class='commentlist'>
          <li id="comment-preview" class="thread-alt alt depth-1">
            <div id="div-comment-preview">
              <div class="comment-author vcard">
                <cite>%‍author%</cite> Says:
              <div class="comment-meta commentmetadata">
                <a title="" href="#comment-preview">%‍date%</a>

    vibhor 11.30.2009 @ 21:20

    very nice !

    vdsvd 12.03.2009 @ 01:54


    asd 12.03.2009 @ 06:21

    Hi thats great

    Adam 12.03.2009 @ 14:22

    This looks great

    meo 12.04.2009 @ 02:30

    some comment

Leave a Reply

Comment Moderation is on; comments with spammy words or a few links might be delayed. Don't worry, they'll get posted soon. If you think something has gone terribly wrong, contact me.

Line and paragraph breaks are inserted automatically and e-mail addresses are never displayed. You may use the following HTML tags in your comments.

<a abbr acronym b blockquote cite code del em i q s strike strong>

© mdawaffe (Michael D Adams) - Powered by WordPress - Full Credits