WordPress comments can boost engagement, but they may not always be the right fit for your website. You may want to disable comments in WordPress to prevent spam, reduce moderation workload, or maintain a cleaner and more professional appearance. Turning off WordPress comments gives you complete control over user interactions.
This guide walks you through multiple methods to disable comments on all posts, specific pages, or your entire site using built-in settings, plugins, and manual techniques.
Table of Contents
- Disable Comments Using Built-in WordPress Settings
- Turn Off WordPress Comments on Media Attachments
- Using Plugins to Disable Comments
- Manually Disabling Comments via functions.php
- Removing Existing Comments
- Removing the “Comments Are Closed” Message
- Why Disable Comments in WordPress?
Disable Comments Using Built-in WordPress Settings
WordPress provides several built-in options to manage your comments section through the admin dashboard. These methods give you flexibility to disable comments globally or selectively.
Disable WordPress Comments Globally on Future Posts
- Navigate to your WordPress dashboard and access the Settings > Discussion section.
- Look for the checkbox labeled “Allow people to post comments on new articles” and uncheck this option.
- Click “Save Changes” to apply your new discussion settings.

This method affects only future posts and pages. Existing content keeps its current comment status. This approach works perfectly for new websites or when you want to prevent comments moving forward while keeping existing discussions intact.
Disable Comments on Individual Posts or Pages
- Edit any specific post or page through your WordPress dashboard.
- In the post editor, locate the Discussion option on the right panel.
- Within the Discussion settings, choose “Closed“.

This gives you precise control over which posts accept comments while maintaining the comments section on others.
Disable Comments on All Posts or Pages in Bulk
- Access Pages > All Pages from your admin dashboard.
- Select multiple pages using the checkboxes, then choose “Edit” from the bulk actions dropdown menu.
- In the bulk edit options, find the Comments dropdown and select “Do not allow.”
- Click “Update” to apply changes across all selected content.

Upgrade Your Website with a Premium WordPress Theme
Find a theme that you love and get a 10% discount at checkout with the FLASH10 code
Choose your theme
Turn Off WordPress Comments on Media Attachments
Media attachments often become spam targets because many users forget to disable comments on uploaded images, videos, and documents. These attachment pages can attract unwanted promotional comments that hurt your site’s credibility.
Manual Method (Advanced Users). The most effective way to disable comments on media attachments involves adding code to your functions.php file. However, this manual approach requires technical knowledge and can break your site if done incorrectly.
WPCode Plugin (Recommended Method). A safer alternative uses the WPCode plugin, which handles code snippets without risking your theme files.
- Install WPCode from your WordPress dashboard
- Navigate to Code Snippets > Add New
- Create a custom snippet titled “Disable Media Comments” and add this code:
function filter_media_comment_status( $open, $post_id ) {
$post = get_post( $post_id );
if( $post->post_type == 'attachment' ) {
return false;
}
return $open;
}
add_filter( 'comments_open', 'filter_media_comment_status', 10 , 2 );
The WPCode plugin provides a user-friendly interface for managing code snippets safely. You can activate or deactivate the media comment restriction anytime without editing theme files directly. This approach protects your customizations when updating themes and reduces the risk of breaking your website’s functionality.
Using Plugins to Disable Comments
Plugins offer the simplest way to disable WordPress comments without technical knowledge. Two popular options provide different approaches to comment management.
Disable Comments Plugin
The Disable Comments plugin gives you complete control over your comments section through the admin panel.
1. Install this plugin from your WordPress dashboard by searching “Disable Comments” in the plugin directory.

2. After activation, navigate to Settings > Disable Comments to configure your preferences:
- “Everywhere” – Removes comments from your entire site, including all post types, admin menu items, and RSS feeds
- “On certain post types” – Allows selective disabling for specific content types

Using WPCode Plugin
WPCode simplifies code snippet management through a library of pre-written solutions.
1. Install WPCode from your WordPress dashboard

2. Access Code Snippets > Code Snippets and search for “Completely Disable Comments“
3. Activate this ready-made snippet.

The WPCode plugin handles all technical aspects automatically. The snippet removes comments from your front-end while hiding comment-related features in your admin dashboard.
Manually Disabling Comments via functions.php
Advanced users can turn off WordPress comments by adding custom code to their theme’s functions.php file. This method provides complete control but requires careful implementation to avoid breaking your website.
Important Prerequisites:
- Create a child theme to preserve customizations during theme updates
- Always back up your website before making changes
- Test modifications on a staging site first
- Access your site files through FTP or your hosting control panel’s file manager
- Navigate to /wp-content/themes/your-child-theme/ and locate the functions.php file
- Add this comment-disabling code at the end of your functions.php file:
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_safe_redirect(admin_url());
exit;
}
// Remove comments metabox from dashboard
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
// Disable support for comments and trackbacks in post types
foreach (get_post_types() as $post_type) {
if (post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
});
// Close comments on the front-end
add_filter('comments_open', '__return_false', 20, 2);
add_filter('pings_open', '__return_false', 20, 2);
// Hide existing comments
add_filter('comments_array', '__return_empty_array', 10, 2);
// Remove comments page in menu
add_action('admin_menu', function () {
remove_menu_page('edit-comments.php');
});
// Remove comments links from admin bar
add_action('init', function () {
if (is_admin_bar_showing()) {
remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
}
});
What This Method Does:
- Removes comment support from all post types
- Closes comments on the front-end
- Hides existing comments
- Removes comment-related admin menu items
The manual approach offers maximum flexibility for developers who need specific customizations. You can modify the code to target particular post types or add additional functionality. However, theme customization requires technical expertise and regular maintenance.
Removing Existing Comments
Disabling comments prevents new submissions but doesn’t remove existing comments from your site. Here’s how to completely clean up your comments section:
- Access the Comments section from your admin dashboard.
- Select all comments using the checkbox at the top of the list.
- Choose “Move to Trash” from the bulk actions dropdown menu and click “Apply“.
- Click the “Trash” link and select “Empty Trash” to permanently remove all comments.

Important Considerations:
- This action cannot be undone, so ensure you want to delete comments before proceeding
- For sites with many comments, repeat this process multiple times since WordPress displays limited comments per page
- Comment management becomes easier when you handle deletions in smaller batches
Removing the “Comments Are Closed” Message
After disabling comments, your theme might still display a “Comments are closed” message. This occurs when themes don’t properly check the comment status before showing comment-related text.
Fix Using File Manager:
- Connect to your website using an FTP client or your hosting provider’s file manager.
- Navigate to your active theme folder at /wp-content/themes/your-theme-name/.
- Locate the comments.php file and rename it to comments_old.php as a backup.
- Create a new empty file named comments.php in the same directory.
This empty file serves as a blank template, preventing any comment-related messages from appearing on your site.
If your theme lacks a comments.php file, contact your theme developer for guidance on removing comment messages. Some themes handle comments through different template files or functions.
Why Disable Comments in WordPress?
Disabling WordPress comments serves several practical purposes for website owners. Here are the key reasons you might want to turn off WordPress comments:
- Prevent Comment Spam. Comment spam represents one of the biggest challenges, with automated bots flooding your posts with irrelevant links and promotional content. Managing this requires constant comment moderation, which drains valuable time from running your business.
- Maintain Professional Appearance. Business websites need clean, focused pages. Static pages, such as services, “About Us,” or contact forms, typically don’t require comment sections. Having comments enabled on these pages can make your site look unprofessional and distract visitors from your main message.
- Improve Site Performance. Site performance improves when you remove comments. Each comment loads additional database queries and can slow down page speed, especially on posts with hundreds of responses. Better site performance leads to improved user engagement and higher search rankings.
- Focus Your Content Strategy. In some scenarios, disabling comments is essential, such as announcement posts where feedback isn’t needed, time-sensitive content that becomes outdated, or corporate websites that focus on lead generation rather than community building.
Build Better WordPress Sites with WPZOOM
Managing comments is just one aspect of creating a professional WordPress website. WPZOOM themes simplify WordPress management with clean, optimized code that reduces spam risks and enhances site performance. Our themes include built-in comment styling options, anti-spam features, and streamlined admin panels that make content management effortless.
Ready to simplify your WordPress experience beyond just comments? Explore WPZOOM’s premium themes designed for hassle-free website management and superior user experience.



September 10, 2024 7:31 am
The code block for the “How to Turn Off Comments on WordPress Manually” section is messed up. There are no line breaks so it’s unusable if you just want to copy the code into your theme’s function.php file.
September 10, 2024 5:43 pm
Sorry about that. It’s fixed now.