Global disable multi-site pingbacks and comments

The following code will disable comments and pingbacks in a WordPress.

add_filter( 'pings_open', '__return_false', 10, 2 );
add_filter( 'comments_open', '__return_false', 10, 2 );

To disable for all multi-site websites, you need run the code inside the /wp-content/mu-plugins folder.

Simple create a new php file inside the folder, for example disable_comments.php

Start the file with an opening


Then add the code from above.

Commands and pingbacks will now be disabled on all the multi-site websites.

Please note – any existing comments may still be displayed, depending on how your theme is configured. You may need to delete existing comments to completely remove the comments section from pages and posts.