Title: [Plugin: Facebook] Moving the comment box
Last modified: August 20, 2016

---

# [Plugin: Facebook] Moving the comment box

 *  [tiagovice](https://wordpress.org/support/users/tiagovice/)
 * (@tiagovice)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-facebook-moving-the-comment-box/)
 * I have just installed and configured the plugin ‘Facebook’, using it solely to
   get the ‘Comment using Facebook’ feature. I know I could do this with other plugins,
   but I would like to use this specific one, not only because it is official, but
   also because it provides Insights that the other ‘Facebook comment’ plugins don’t.
 * The problem I am facing is that the comment box appears at the end of the post,
   instead of appearing at the comment section that is there specifically for articles.
 * Article structure example (with the plugin enabled):
 *     ```
       Article Title
       --------------------------
       Article Body
       ...
       ...
       ...
       --------------------------
       Facebook Comments
       --------------------------
       Share box
       --------------------------
       Comment area (empty)
       --------------------------
       <- Previous [Post] Next ->
       ```
   
 * I’am quite a rookie when it comes to wordpress plugins, I would be able to change
   the comment location if I found out how the hooks work and I realise that it’s
   as easy as changing code from one div to another.
 * How can I move the ‘Facebook Comment’ interface to the comment area?
 * Thanks in advance 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [aendrew](https://wordpress.org/support/users/aendrew/)
 * (@aendrew)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-facebook-moving-the-comment-box/#post-3037848)
 * +1 for this. I’ve been trying to use remove_filter(); and add_filter(); for the
   better part of the last hour to move everything but it simply isn’t working. 
   Some help?
 *  [aendrew](https://wordpress.org/support/users/aendrew/)
 * (@aendrew)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-facebook-moving-the-comment-box/#post-3037849)
 * Nevermind, I figured it out.
 * In functions.php:
 *     ```
       /**
        * Move FB Comments to own DIV.
        */
   
       add_action('init', 'move_fb_comments');
   
       function move_fb_comments() {
           remove_filter( 'the_content', 'fb_comments_automatic', 30 );
           add_filter( 'comment_form_before', 'fb_comments_automatic', 30);
       }
       ```
   
 * Then, where-ever you want to put the comment form:
    `<?php echo apply_filters('
   comment_form_before', $post->post_content); ?>`
 * I have no idea if this is even slightly-sane WordPress code, but it works for
   me.
 *  [aendrew](https://wordpress.org/support/users/aendrew/)
 * (@aendrew)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-facebook-moving-the-comment-box/#post-3037850)
 * Apparently the code I posted an hour ago causes the content to repeat twice. 
   Try this instead:
 *     ```
       /**
        * Move FB Comments to own DIV.
        */
   
       add_action('init', 'move_fb_comments');
   
       function hook_fb_comments_form() {
           do_action('the_fb_comment_form');
       }
   
       function move_fb_comments() {
           remove_filter( 'the_content', 'fb_comments_automatic', 30 );
           add_filter( 'the_fb_comment_form', 'fb_comments_automatic', 30);
       }
       ```
   
 * And then, where you want the box:
 *     ```
       <?php echo apply_filters('the_fb_comment_form', NULL); ?>
       ```
   
 * Hope this saves somebody the several frustrating hours I just had…
 *  [aendrew](https://wordpress.org/support/users/aendrew/)
 * (@aendrew)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-facebook-moving-the-comment-box/#post-3037880)
 * The filters changed last update; the above code should now be:
 * `
    /** * Move FB Comments to own DIV. */
 * add_action('wp', 'move_fb_comments', 999999);
 * function hook_fb_comments_form() {
    do_action('the_fb_comment_form'); }
 * function move_fb_comments() {
    $priority = apply_filters( 'facebook_content_filter_priority',
   30 ); remove_filter( 'the_content', 'Facebook_Comments::the_content_comments_box',
   $priority); add_filter( 'the_fb_comment_form', 'Facebook_Comments::the_content_comments_box',
   30); }
 *  [tatof](https://wordpress.org/support/users/tatof/)
 * (@tatof)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-facebook-moving-the-comment-box/#post-3037895)
 * awesome! only still repeats with the last update of your script
 * change the remove_filter to:
    `remove_filter( 'the_content', array( 'Facebook_Comments','
   the_content_comments_box' ), $priority );`
 *  [Littledev-fromspace](https://wordpress.org/support/users/littledev-fromspace/)
 * (@littledev-fromspace)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-facebook-moving-the-comment-box/#post-3037899)
 * i am trying to use this code but I have
    `Fatal error: Call to undefined function
   add_action() in /data/var/www/localhost/htdocs/blague/wp-includes/functions.php
   on line 3849`
 * What I am doing wrong ?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Facebook] Moving the comment box’ is closed to new replies.

## Tags

 * [box](https://wordpress.org/support/topic-tag/box/)
 * [comment](https://wordpress.org/support/topic-tag/comment/)
 * [moving](https://wordpress.org/support/topic-tag/moving/)

 * 6 replies
 * 4 participants
 * Last reply from: [Littledev-fromspace](https://wordpress.org/support/users/littledev-fromspace/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-facebook-moving-the-comment-box/#post-3037899)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
