I haven’t done this personally, but it would be pretty easy. If you are building your comment form manually, just before the end of the </form> put:
<?php wp_nonce_field( 'comment_nonce' ) ?>
Then, just hook into the pre_comment_on_post action which fires when you submit a comment:
add_action( 'pre_comment_on_post', 'my_verify_comment_nonce' );
function my_verify_comment_nonce() {
check_admin_referer( 'comment_nonce' );
}
If you want to just hook into the standard comment form that Twenty Ten uses (comment_form()) then you could instead hook into comment_form like so:
add_action( 'comment_form', 'my_add_comment_nonce_to_form' );
function my_add_comment_nonce_to_form() {
wp_nonce_field( 'comment_nonce' );
}
Not tested, so let me know if you have any issues!
Related Posts:
- What are the package and subpackage comment for?
- adding a text message beside the comment submit button
- Akismet plugin is deleting spam despite preferences
- posts comments goes to trash
- Moving FB comments at the end of page
- Display WordPress comments before the plugins?
- Disable plugin / plugin action via theme
- Where can I sell WordPress themes and plugins? [closed]
- How to add plugins to wordpress theme?
- Disabling Comment Notifications for Post Author
- Disable author pages for specific users
- Are there any drawbacks to install IntenseDebate on my blog?
- Set active theme via URL
- How do I make my wordpress page more friendly for mobile viewers?
- Notify commenters about new replies
- Use comments as notes, visible for comment author only
- Check javascript file Proper way in functions.php
- How does WooCommerce display a custom comment_type in Comment Admin?
- Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint
- How to prevent spam comments?
- Intercept comment form submit/list by hook/filter
- How to add a privacy-checkbox in comment-template?
- Recommendations for books/resource to get started with wordpress 3 development (plugins/themes) [closed]
- Uncaught Error: Call to undefined function get_user_by() after moving function from theme to plugin
- Override comments.php template with plugin
- How to Implement “Notice: This theme recommands the following plugin:xyz” in wordpress? [closed]
- Change settings of get_post_type_object
- Sage WordPress – Plugin Namespace: Not Found
- Function to prevent users from trashing comments
- Unable to install theme recommended plugins on Multisite
- More than one text-domain is being used because of the included templates for plugins
- How do you override the default comment template?
- How to prevent users to download videos from lms website?
- plugin style conflicts, how to override? [closed]
- There is any way to remove post-format filter? [closed]
- Send reply with pre-prepared answers
- WordPress site periodically goes down
- Masonry images not working
- (Big issue) Blog is Getting Down Each day.. what should i do.?
- How to require users to login when not logged in
- Error when using plugin QuickCache with plugin Mobile Smart ? [closed]
- How do I find out what is in control over a certain part of a website?
- Overwrite category head title
- Create custom pages with a plugin
- Does heavy theme and plugins affect server’s response time? [closed]
- Proper way to use plugin functions in functions.php
- Use different single.php file based on condition
- Flag Comment as inappropriate button plugin
- how remove font to increase site speed load
- Use $variable from file1.php in file2.php (different file paths)
- What is the purpose of WP_CONTENT_URL?
- issue in wp_localize_script
- How can I use my custom wordpress theme on two websites? [closed]
- Can I filter a function created by a theme or a plugin?
- How I update WordPress theme and plugins
- Overwrite add_image_size defined by theme
- Detect plugin/theme installation (via upload)
- How to check homepage contain blog post?
- how to design change in woocommerce cart page and all other page also by theme? [closed]
- is there a way to pass a parameter to a add_menu_page function?
- plugin inside a wordpress theme
- Share plugins, themes, and multi post in a multidomain network
- Removing the custom_image_header from wp_head
- Gantry Framework: new page loads homepage content instead of page content
- Upgrade not working & themes not supporting
- Plugin Admin panel checkbox unchecked after submit
- use EDD Content Restriction for restricting php in template
- admin-ajax.php 500 error when new users try to register
- Why the internal link get converted into a comment?
- Elementor Sidebar not loading when PRO elements plugin is active
- Elementor pro page editing gives error There has been a critical error on this website. Please check your site admin email inbox for instructions
- What plugin would make this happen? If is the theme
- WordPress site hamburger menu toggle not working
- WordPress wp get_temp_dir return non exiting folder, thus failing plugin & themes update
- when i activate my WordPress plugin cannot see customizer options or preview
- Writing SEO for Homepage when homepage is set to display latest posts
- Fatal error: Class ‘RDTheme’ not found
- Comment restrictions Wodpress
- How is it possible to create Multi part sections where people can answer or comment or vote on various parts of a page’s content as given example?
- Getting unknown text in footer of email
- How to fix blog article view and share #’s?
- Description: Too much time has passed without sending any data for document
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- I want add repository theme folder
- Paginated Comments “reply” does not work!
- Need Help Creating a Multi-Step, Video-Guided Enrollment Site
- Issues with Post 2 Post Plugin
- Why links are not linked if edited comment?
- Disqus plugin outputs script as literal text
- How to get current template file used by WordPress?
- How can I modify the colors of my theme for a single section of my site? [closed]
- How to work email subscribe in WordPress?
- Terms id wordpress error
- How to add a plugin in WordPress theme directory?
- How to make wordpress backend mobile optimized.?
- Editing a theme
- What is phpBB? Is it something like a plugin which I can use in WordPress? [closed]
- How to Allow Users to Select Recipients In a WordPress Comment section?
- WordPress theme is not displaying the correct home page in the Pages section
- Newspaper theme, custom query vars, & custom rewrite rules