There’s a preprocess_comment
filter that is run before the comment is inserted in the database.
You will have access to the comment’s data:
add_filter( 'preprocess_comment' , 'wpse321083_process_recaptcha' );
function wpse321083_process_recaptcha( $commentdata ) {
// Process recaptcha here
return $commentdata;
}
Here’s also a good article on SitePoint.com explaining how to implement this feature in your website.
Related Posts:
- Is it possible to filter comments in a post so a user can only see the comments they have written?
- Using filter to add additional fields to comment_form()
- How to enable visual editor when editing comments on the dashboard?
- Adding custom column to comments admin panel?
- Why anything done on comments_array hook gets reset?
- How to take options from form fields and turn them in to links?
- How Does comment_author Filter Work?
- How to modify core when there is no hook?
- How to remove medium size class in gravity form for input tag?
- I want to allow the use of a data-flw attribute in links in comments
- Building a request processor for multi-page forms, etc using $_GET requests
- Comment search plugin
- Filtering Comment Reply Links (comment_reply_link_args) for “infinite replies” in nested comments
- How to allow code block in wordpress comments
- Use of comment_reply_link_args filter
- Remove Comment Author Link only for subscribers
- Use has_filter on comment_post
- Remove comments validation (remove filter?)
- Search a title word through query_posts (not the exact match)
- How do I add tags to entire comments, not just their text
- comment_notification_text filter not working
- Modify author url display in edit-comments.php
- How can I filter the comment action links so that I can display the actions links based on user capabilities?
- Converting restricted html in comments to bbcode
- Custom registration field to SQL database
- GET form action. Redirect to self
- Changing WooCommerce Display Price Based on User Role & Category [closed]
- LESS CSS enqueue_style with add_filter to change rel attribute
- Remove Editor From Homepage
- What do add_filters() and apply_filter() do?
- What to use instead of the content_save_pre filter?
- Moving sharedaddy buttons (in Jetpack) to the top of a post?
- How can I customize the wp_list_categories
- How can I reliably and globally disable wptexturize?
- Customise Jetpack Publicize text
- Can’t change a label in woocommerce with the normal filter
- Add classname to the_category() function?
- Filter the URL of next_posts_link & previous_posts_link
- Sensei LMS Hooks to Remove Content
- How to re-enable a filter after disabling with __return_false
- Exclude One Category and its Subcategories using WP_LIST_FILTER
- Explanation for remove_filter used in the below code [closed]
- Gutenberg disable the “block” tab in right sidebar
- Where is this inline CSS code [closed]
- When to use actions and when to use filters
- add_filter to ‘woocommerce_before_main_content’ [closed]
- Editing
- add_filter to apply_filters that exists within class
- Echoing Categories only if they’re a child of a given category
- WordPress custom form action url
- Why in archive page doesn´t show read more button with excerpt?
- Removal of Jetpack OG Tags from old blog site
- Adding a title prefix with the the_title filter
- How to modify an existing meta description?
- Don’t see add_filter result in the site front page
- How can I include an existing custom sitemaps listing in wp-sitemap.xml?
- Display Externally Retrieved Data within a Custom Template
- Can the wordpress color palettes by changed through Javascript?
- Why does my callback function not work with this custom filter hook?
- Filter on the_content doesn’t update the content being searched via register_rest_route
- How to access plugin variables from theme templates without using globals?
- Make an array filterable per hook
- add img class to native wordpress galleries
- Get Posts updated or published within the last x hours
- preview_post_link for Custom Post Types
- Filter an array with a callback – for single & multidimensional arrays
- Alter required message using comment form api
- Detect when gutenberg editor title is available in Dom after editor load
- Why this filter hook is not working when passing parameters?
- Are href attributes of a elements filtered on output to add the current path?
- Add a filter to an action [closed]
- Regarding post text filtering
- Add Filter not working with get_posts
- How to Prevent WordPress to encode html in post?
- Why template_include filter does not work with WPML plugin?
- Most performant/functional way to add actions/filters?
- Making an add_filter() call from within an add_filter() call
- Action hook to control access to certain parts of my site
- Add captcha validation to my custom form for Frontend posting
- Finding actual functions added to hooks and filters
- How to apply filter on get_the_post_thumbnail()
- Use alternative front page if cookie is set
- How do I check if I can use the allowed_block_types filter?
- Setting the page title in a plugin, but not outside my plugin
- how to output HTML tags in post_content and not as plain text
- Security question – Display a General Custom Login Error Message
- Add filter conditionally to a page
- How to apply a filter to everything?
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Conditionally (cpt) filter previous and next_post_link
- changing size image within the content
- Remove action added from class
- How do I remove certain HTML elements with specific classes from the feed?
- Identify admin/logout and more filters
- Sanitizing a custom query’s clauses
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- How to create a list of terms who’s posts also have a predefined external term?
- Can you call a filter hook by “add_action”?
- Why isn’t this add_filter function working as expected?
- Adding filter to the Contact Form 7 response