# Turn Off Comments on New Network Sites

> Creates every new site with comments, pingbacks and trackbacks switched off by default, for networks of brochure or business sites.

- Type: PHP
- Runs: Run everywhere
- Category: [Multisite](https://wpide.com/library/category/multisite/)
- Tags: new-site, comments, defaults
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/ms-new-site-close-comments/

## Code

```php
if ( ! is_multisite() ) {
    return;
}

add_action( 'wp_initialize_site', function ( $site ) {
    switch_to_blog( $site->blog_id );
    update_option( 'default_comment_status', 'closed' );
    update_option( 'default_ping_status', 'closed' );
    update_option( 'default_pingback_flag', 0 );
    restore_current_blog();
}, 200 );
```

## Notes

Site owners can still turn comments on in Settings > Discussion.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Turn Off Comments on New Network Sites" 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/
