{"id":5125,"date":"2022-10-31T04:45:42","date_gmt":"2022-10-31T04:45:42","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=5125"},"modified":"2022-10-31T04:47:55","modified_gmt":"2022-10-31T04:47:55","slug":"add-google-recaptcha-to-wordpress-comment-form-without-plugin","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/","title":{"rendered":"Add Google reCAPTCHA to WordPress Comment Form without Plugin"},"content":{"rendered":"<p>Google reCAPTCHA is the easiest option to add CAPTCHA functionality to the website. Mostly, the CAPTCHA feature is used in the HTML form to protect from spam submission. In reCAPTCHA v2, a checkbox widget is added to the form and the user needs to check it to process the request. The user&#8217;s response is validated with reCAPTCHA API and the request is processed further. You can integrate the Google reCAPTCHA v2 checkbox with PHP easily in the web form.<\/p>\n<p>There are various plugins available to integrate reCAPTCHA v2 checkbox in WordPress. If you want complete control in the reCAPTCHA widget and add Google reCAPTCHA without using any plugins, it can be done easily with manual integration. In this tutorial, we will show you how to <b>add Google reCAPTCHA to WordPress comment form<\/b> without plugin.<\/p>\n<p>Follow the below simple steps to integrate reCAPTCHA v2 checkbox into the comment form in WordPress.<\/p>\n<h2>Create reCAPTCHA v2 API Keys<\/h2>\n<p>Before getting started register reCAPTCHA v2 keys on the Google reCAPTCHA Admin console.<\/p>\n<p>Visit the <a href=\"https:\/\/www.google.com\/recaptcha\/admin\" target=\"_blank\" rel=\"noopener\">reCAPTCHA admin console<\/a> and register the domain of your website.<\/p>\n<ul class=\"bullet_disk_list\">\n<li><b>Label<\/b> &#8211; It helps to identify your registered site in the future.<\/li>\n<li><b>reCAPTCHA type<\/b> &#8211; Select <b>reCAPTCHA v2 \u00bb I\u2019m not a robot<\/b> Checkbox<\/li>\n<li><b>Domains<\/b> &#8211; Specify the domain of your website.<\/li>\n<\/ul>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3942\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-add-site-domain-codexworld.png\" alt=\"google-recaptcha-v2-checkbox-add-site-domain-codexworld\" width=\"772\" height=\"613\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-add-site-domain-codexworld.png 772w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-add-site-domain-codexworld-300x238.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-add-site-domain-codexworld-768x610.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-add-site-domain-codexworld-200x159.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-add-site-domain-codexworld-290x230.png 290w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/div>\n<p>On submission, the reCAPTCHA v2 <b>Site Key<\/b> and <b>Secret Key<\/b> will be generated. Note these keys which will be used later in the code.<\/p>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3943\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-create-site-key-secret-codexworld.png\" alt=\"google-recaptcha-v2-checkbox-create-site-key-secret-codexworld\" width=\"802\" height=\"570\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-create-site-key-secret-codexworld.png 802w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-create-site-key-secret-codexworld-300x213.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-create-site-key-secret-codexworld-768x546.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-create-site-key-secret-codexworld-200x142.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/07\/google-recaptcha-v2-checkbox-create-site-key-secret-codexworld-324x230.png 324w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/div>\n<h2>Load reCAPTCHA JavaScript API<\/h2>\n<p>Edit the <b>single.php<\/b> file of the active theme directory and add the following code after the <code>get_header();<\/code>.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>If the active theme of your WordPress site is <b>Twenty Twenty-Two<\/b>, edit the <code>single.php<\/code> file from the <code>wp-content\/themes\/twentytwentytwo<\/code> directory.<\/li>\n<\/ul>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"https:\/\/www.google.com\/recaptcha\/api.js\"<\/span> <span class=\"hljs-attr\">async<\/span> <span class=\"hljs-attr\">defer<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<h2>Add reCAPTCHA and Verify Response<\/h2>\n<p>Edit the <b>functions.php<\/b> file of the active theme directory and add the following code.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>In the <code>add_google_recaptcha()<\/code> function, specify the Site Key in the <code>data-sitekey<\/code> attribute.<\/li>\n<li>In the <code>is_valid_captcha_response()<\/code> function, specify the Secret Key in the <code>secret<\/code> key of the <code>$captcha_postdata<\/code> array.<\/li>\n<\/ul>\n<pre><span style=\"color: #FF8000\">\/** <br \/>&nbsp;*&nbsp;Google&nbsp;reCAPTCHA:&nbsp;Add&nbsp;widget&nbsp;before&nbsp;the&nbsp;submit&nbsp;button <br \/>&nbsp;*\/ <br \/><\/span><span style=\"color: #007700\">function&nbsp;<\/span><span style=\"color: #0000BB\">add_google_recaptcha<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$submit_field<\/span><span style=\"color: #007700\">)&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$submit_field<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'submit_field'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;div&nbsp;class=\"g-recaptcha\"&nbsp;data-sitekey=\"Your_reCAPTCHA_Site_Key\"&gt;&lt;\/div&gt;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$submit_field<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'submit_field'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">$submit_field<\/span><span style=\"color: #007700\">; <br \/>} <br \/> <br \/>if&nbsp;(!<\/span><span style=\"color: #0000BB\">is_user_logged_in<\/span><span style=\"color: #007700\">())&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">add_filter<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'comment_form_defaults'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'add_google_recaptcha'<\/span><span style=\"color: #007700\">); <br \/>} <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/** <br \/>&nbsp;*&nbsp;Google&nbsp;reCAPTCHA:&nbsp;verify&nbsp;response&nbsp;and&nbsp;validate&nbsp;comment&nbsp;submission <br \/>&nbsp;*\/ <br \/><\/span><span style=\"color: #007700\">function&nbsp;<\/span><span style=\"color: #0000BB\">is_valid_captcha_response<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$captcha<\/span><span style=\"color: #007700\">)&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$captcha_postdata&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">http_build_query<\/span><span style=\"color: #007700\">( <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array( <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'secret'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'Your_reCAPTCHA_Secret_Key'<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'response'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$captcha<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'remoteip'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$_SERVER<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'REMOTE_ADDR'<\/span><span style=\"color: #007700\">] <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;) <br \/>&nbsp;&nbsp;&nbsp;&nbsp;); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$captcha_opts&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;array( <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'http'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;array( <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'method'&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'POST'<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'header'&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'Content-type:&nbsp;application\/x-www-form-urlencoded'<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'content'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$captcha_postdata <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">) <br \/>&nbsp;&nbsp;&nbsp;&nbsp;); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$captcha_context&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">stream_context_create<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$captcha_opts<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$captcha_response&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">json_decode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">file_get_contents<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"https:\/\/www.google.com\/recaptcha\/api\/siteverify\"<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">false<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$captcha_context<\/span><span style=\"color: #007700\">),&nbsp;<\/span><span style=\"color: #0000BB\">true<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;if(!empty(<\/span><span style=\"color: #0000BB\">$captcha_response<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'success'<\/span><span style=\"color: #007700\">])){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">true<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;}else{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">false<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>} <br \/> <br \/>function&nbsp;<\/span><span style=\"color: #0000BB\">verify_google_recaptcha<\/span><span style=\"color: #007700\">()&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$recaptcha&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'g-recaptcha-response'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;if(empty(<\/span><span style=\"color: #0000BB\">$recaptcha<\/span><span style=\"color: #007700\">)){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">wp_die<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">__<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"&lt;b&gt;ERROR:&nbsp;&lt;\/b&gt;&lt;b&gt;Please&nbsp;select&nbsp;captcha&nbsp;checkbox.&lt;\/b&gt;&lt;p&gt;&lt;a&nbsp;href='javascript:history.back()'&gt;\u00ab&nbsp;Back&lt;\/a&gt;&lt;\/p&gt;\"<\/span><span style=\"color: #007700\">)); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;}elseif(!<\/span><span style=\"color: #0000BB\">is_valid_captcha_response<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$recaptcha<\/span><span style=\"color: #007700\">)){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">wp_die<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">__<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"&lt;b&gt;Sorry,&nbsp;spam&nbsp;detected!&lt;\/b&gt;\"<\/span><span style=\"color: #007700\">)); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>} <br \/> <br \/>if&nbsp;(!<\/span><span style=\"color: #0000BB\">is_user_logged_in<\/span><span style=\"color: #007700\">())&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">add_action<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'pre_comment_on_post'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'verify_google_recaptcha'<\/span><span style=\"color: #007700\">); <br \/>}<\/span><\/pre>\n<p>That&#8217;s it, the reCAPTCHA checkbox widget will be added to the comment form throughout the WordPress site.<\/p>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/wordpress-comment-form-google-recaptcha-v2-checkbox-codexworld-973x1024.png\" alt=\"wordpress-comment-form-google-recaptcha-v2-checkbox-codexworld\" width=\"960\" height=\"1010\" class=\"alignnone size-large wp-image-5127\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/wordpress-comment-form-google-recaptcha-v2-checkbox-codexworld-973x1024.png 973w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/wordpress-comment-form-google-recaptcha-v2-checkbox-codexworld-285x300.png 285w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/wordpress-comment-form-google-recaptcha-v2-checkbox-codexworld-768x808.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/wordpress-comment-form-google-recaptcha-v2-checkbox-codexworld-200x210.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/wordpress-comment-form-google-recaptcha-v2-checkbox-codexworld-219x230.png 219w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/wordpress-comment-form-google-recaptcha-v2-checkbox-codexworld.png 983w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/div>\n<p class=\"seeAlso\"><span><\/span><a href=\"https:\/\/www.codexworld.com\/new-google-recaptcha-with-php\/\">Integrate Google reCAPTCHA Checkbox with PHP<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google reCAPTCHA is the easiest option to add CAPTCHA functionality to the website. Mostly, the CAPTCHA feature is used in the HTML form to protect from spam submission. In reCAPTCHA v2, a checkbox widget is <\/p>\n","protected":false},"author":1,"featured_media":5131,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[208,21,25],"class_list":["post-5125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-captcha","tag-google-recaptcha","tag-wordpress","cat-5-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Add Google reCAPTCHA to WordPress Comment Form without Plugin - CodexWorld<\/title>\n<meta name=\"description\" content=\"Add Google reCAPTCHA to the comment form in WordPress - Integrate reCAPTCHA v2 checkbox in the WordPress comment form without plugin.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add Google reCAPTCHA to WordPress Comment Form without Plugin - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Add Google reCAPTCHA to the comment form in WordPress - Integrate reCAPTCHA v2 checkbox in the WordPress comment form without plugin.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-31T04:45:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-31T04:47:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Add Google reCAPTCHA to WordPress Comment Form without Plugin\",\"datePublished\":\"2022-10-31T04:45:42+00:00\",\"dateModified\":\"2022-10-31T04:47:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/\"},\"wordCount\":351,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png\",\"keywords\":[\"Captcha\",\"Google reCAPTCHA\",\"WordPress\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/\",\"name\":\"Add Google reCAPTCHA to WordPress Comment Form without Plugin - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png\",\"datePublished\":\"2022-10-31T04:45:42+00:00\",\"dateModified\":\"2022-10-31T04:47:55+00:00\",\"description\":\"Add Google reCAPTCHA to the comment form in WordPress - Integrate reCAPTCHA v2 checkbox in the WordPress comment form without plugin.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add Google reCAPTCHA to WordPress Comment Form without Plugin\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add Google reCAPTCHA to WordPress Comment Form without Plugin - CodexWorld","description":"Add Google reCAPTCHA to the comment form in WordPress - Integrate reCAPTCHA v2 checkbox in the WordPress comment form without plugin.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/","og_locale":"en_US","og_type":"article","og_title":"Add Google reCAPTCHA to WordPress Comment Form without Plugin - CodexWorld","og_description":"Add Google reCAPTCHA to the comment form in WordPress - Integrate reCAPTCHA v2 checkbox in the WordPress comment form without plugin.","og_url":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2022-10-31T04:45:42+00:00","article_modified_time":"2022-10-31T04:47:55+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Add Google reCAPTCHA to WordPress Comment Form without Plugin","datePublished":"2022-10-31T04:45:42+00:00","dateModified":"2022-10-31T04:47:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/"},"wordCount":351,"commentCount":1,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png","keywords":["Captcha","Google reCAPTCHA","WordPress"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/","url":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/","name":"Add Google reCAPTCHA to WordPress Comment Form without Plugin - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png","datePublished":"2022-10-31T04:45:42+00:00","dateModified":"2022-10-31T04:47:55+00:00","description":"Add Google reCAPTCHA to the comment form in WordPress - Integrate reCAPTCHA v2 checkbox in the WordPress comment form without plugin.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png","width":1366,"height":768,"caption":"add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/add-google-recaptcha-to-wordpress-comment-form-without-plugin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Add Google reCAPTCHA to WordPress Comment Form without Plugin"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2022\/10\/add-google-recaptcha-to-wordpress-comment-form-without-plugin-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-1kF","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=5125"}],"version-history":[{"count":6,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5125\/revisions"}],"predecessor-version":[{"id":5134,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5125\/revisions\/5134"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/5131"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=5125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=5125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=5125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}