# Move the Comment Box Below the Name and Email Fields

> Reorders the comment form so visitors fill in their name and email before writing the comment, the order many themes used before WordPress 4.4.

- Type: PHP
- Runs: Run everywhere
- Category: [Comments](https://wpide.com/library/category/comments/)
- Tags: comments, form, layout
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/comment-field-last/

## Code

```php
add_filter( 'comment_form_fields', function ( $fields ) {
    if ( ! isset( $fields['comment'] ) ) {
        return $fields;
    }

    $comment = $fields['comment'];
    unset( $fields['comment'] );

    $cookies = isset( $fields['cookies'] ) ? $fields['cookies'] : null;
    unset( $fields['cookies'] );

    $fields['comment'] = $comment;

    if ( null !== $cookies ) {
        $fields['cookies'] = $cookies;
    }

    return $fields;
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Move the Comment Box Below the Name and Email Fields" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
