Considering that in Settings > Discussion
you have this options checked:
The first is comment_moderation
and the second comment_whitelist
.
Then, it is possible to selectively disable them using the filter pre_option_(option-name)
, as follows:
add_filter( 'pre_option_comment_moderation', 'wpse_72990_auto_aprove_selective' );
add_filter( 'pre_option_comment_whitelist', 'wpse_72990_auto_aprove_selective' );
function wpse_72990_auto_aprove_selective( $option )
{
global $post;
if( $post->ID == 2 )
return 0;
return $option;
}
Related Posts:
- How to remove the Theme Customization Button from the dashboard and themes options page?
- What filters are applied to the_content function?
- Change admin bar to default:off
- How to modify an image block in Gutenberg WordPress 5?
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- Nested comments ignored for max per page in wordpress
- wp_get_attachment_image_attributes not working for me
- Display a different theme for not logged-in users
- Custom Comments – Parent / Nested Reply
- Why is styling comments so complex?
- Run shortcode before filters
- Comment form not display properly?
- Add class to before_widget for all widgets with a dropdown and a counter
- comment_form() generates the wrong action url
- Get password when user registers and save it sha1 into database
- Customize comment list markup
- Passing variable in hooks and filter
- how to pull wordpress post comments to a external page
- Separated Comment from Post
- Remove “a href” from wp_list_comments()
- WordPress nav_menu_css_class theme filter is not being called
- customizing the_password_form filter
- How to call wp_list_comments() with callback outside the loop
- WordPress Genesis Child Theme Filter divs
- Change file name from wp_generate_attachment_metadata
- How to get comment meta values by post ID
- Compact pingback list with favicons
- Simple way to get two language WP site
- How to change i18n/l10n of #reply-title? (Old title: Comment reply link not working)
- How to remove comment link title attribute?
- Comment entry screen shows even though “Allow Comments” is unchecked
- Highlight “Show all” item in wp_list_categories
- When trying to override plugin’s function by theme, my filter executes two times, I want it to run only a single time
- Menu item added in wp_nav_menu_items filter is never highlighted
- Jetpack Comments with fall-back
- Should I use add_filter for functions in function.php of the theme?
- Pass variable to hook. Its possible?
- WP_Comment_Query – Get comments and answers separately
- WordPress taxonomy and archive custom class
- Filter categories used with Custom Structure Permalink
- Trackbacks not displaying
- Nested comments in WordPress theme
- How to wrap all titles generated by Gutenberg “Heading” block with tag
- Replace single_template filter with what for default posts?
- Comment status shows ‘closed’ in db, but it shows ‘open’ when i echo it
- Unique design inside a specific category’s url
- How to rotate every letter in a title
- How to disable thumbnail filter for a specific template part or image size?
- CSS class on last post in loop ( custom query )
- How to change footer credit text in Twenty Twenty One theme with a hook?
- Use a filter on menu items that have children
- Modify available templates (in dropdown)
- Difference between “comment_form_default_fields” AND “comment_form_fields”
- How to enable Disqus comments in a WordPress theme I’m creating from scratch? [closed]
- How to add custom class to get_avatar()
- Same comments on all posts
- tiny_mce_before_init: ‘exact’ => true has no effect
- How to conditionally add a wp_filter
- Filter didn’t work on content class (hybrid_post_attributes)
- How to set default values for edit_post_link() in my theme?
- WordPress Comment spam issue
- Tiny MCE custom styles, and preview in the backend
- content filter (add_filter) for category description?
- WordPress comments title
- Related Post Category Filter
- Pagination don’t work with active filters
- How to register dynamic settings in WordPress Customizer?
- restrain filter on get_the_excerpt to queried item in stead of current post
- Ajax Comment Upvotes – Votes don’t always register
- WordPress wp_get_current_user returning blank values until refresh
- Alternative solution for script_loader_tag?
- Alt header logo and link for specific pages
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- Make a custom field in admin post.php read only
- Hook in parent theme Menu function
- How do I remove p tag *insertions*? Disabling `wpautop` removes manual tags
- How to add custom nav_menu_css_class to certain menu only?
- How to manipulate wordpress template tags’ output
- Modify comments_popup_link output
- Woocommerce Theme Reviews / Comments
- what is do_action(); in wordpress? [duplicate]
- child comments not displaying as nested
- How can I fix the even/odd child classes comments so that the comments are unaffected by the top-level even/odd?
- wp_update_comment not working
- Suppress the_content filter in a nested loop
- apply_filters to featured image
- Add rel to all images in a post
- Recent posts with comment count in “Sidebar” template [closed]
- Is there a Function so that the author of the comment can delete his own comment?
- Is there any filter or action hook to remove layout classes from appearing in my templates?
- Only show read more text when when wp:post-excerpt meets excerptLength
- WP “optimizing” PNGs into thumbnails 5X larger than originals – FIX
- optimized PNGs 5X larger than originals
- Menu items description? Custom Walker for wp_nav_menu()
- How to define and link full path to css located at a random folder on header.php
- Sizing screenshot.png without losing aspect ratio
- Software for WordPress Theme and Plugin Development? [closed]
- When to use is_home() vs is_front_page()?
- What is the preferred way to add custom javascript files to the site?
- Get the blog page URL set in Options