Sometimes you only want to disable comments in WordPress on a specific post or page. Maybe it’s an older article, an announcement or a page where comments don’t make sense (like your “Contact Us” page). WordPress makes this super easy with its built-in settings. Here’s how: 1. ...
如果要删除整站评论,就选择“Everywhere: Delete all comments in WordPress.”,然后点击“Delete Comments”按钮如果要删除指定文章类型的文章评论,就在“For certain post types:”中选择,然后点击“Delete Comments”按钮4、点击【设置】下的“Disable Comments”进入禁止评论界面:...
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 ...
$post =get_post($post_id); if($post->post_type =='attachment'){ returnfalse; } return$open; } add_filter('comments_open','disable_media_comment',10,2); 4. 单击更新文件完成更改。 方法6:使用 WordPress 插件禁用评论 使用Disable Comments插件能更快速、简单的禁用评论。 在wordpress仪表板,转...
Step 1: Open the blog post or page on which you want to disable the comments. Step 2: Scroll down to the Discussion section and uncheck the box that says “Allow comments”. Step 6: Click Update to save your changes. Repeat these steps for each post that you want to disable comments...
add_filter( 'notify_post_author', '__return_false' ); add_filter( 'notify_moderator', '__return_false' ); 方法三:使用插件 如果你更喜欢使用插件,可以使用插件来禁用评论通知。以下是一些常用插件: Disable Comments插件:这个插件不仅可以禁用评论,还可以禁用评论相关的所有功能,包括邮件通知。
How to disable comments on media How to disable comments using a plugin [/article_callout] Why Should you Care About Comments? Comments on a post or page may not seem like a major concern, but they can be. While they’re great for engaging site visitors in discussion, it’s important ...
How to disable comments on a WordPress post/page How to disable WordPress comments for multiple pages/posts How to turn off and remove all WordPress comments Disable and remove comments manually Use a “disable comments” plugin Turn off comments from the theme’s functions.php file Summary...
域名备案期间,管局规定网站不允许有评论功能。虽然可以在WP后台设置禁止评论,但对之前发表的文章无效,修改主题模板删除评论模块代码比较麻烦,通过安装Disable Comments(禁止评论)插件,帮你一键关闭全站评论功能。 WordPress后台安装插件页面,直接搜索:Disable Comments安装。
要在WordPress中禁止某些用户评论,你可以使用代码来实现。你可以在你的主题的functions.php文件中添加以下代码:function disable_comments_for_specific_users( $open, $post_id ) { $user = wp_get_current_user();// 定义禁止评论的用户ID数组 $disallowed_users = array( 2, 3, 4 ); // 将这里的数字...