Adding ReCaptcha for K2 on Joomla

Step 1. Add your site on Google ReCaptcha

  1. Go to Google ReCaptcha
  2. Log in with your Google account
  3. Go to My Account
  4. Click “Add a New Site” button and enter your website URL
  5. You will get public and private keys for that site

Step 2. Activate and configure ReCaptcha on K2

  1. Log in your Joomla admin panel
  2. Go to Components > K2 > Parameters > Comments
  3. Click on K2 Parameters button on top-right menu
  4. Open Comments tab and set “Active reCaptcha” to Yes
  5. Open Advanced tab, go to the Anti-Spam section and paste the previously obtained public and private keys
  6. Save!

If it doesn’t work yet, in my case, I have had to modify some code. Open this file:


and update the new repository URL:

//$document->addScript(''); // Old URL
$document->addScript(''); // New URL

Also, in the same file, I needed to remove some lines (see the commented lines):

$js = '
  function showRecaptcha(){
    Recaptcha.create("'.$item->params->get('recaptcha_public_key').'", "recaptcha", {
    theme: "'.$item->params->get('recaptcha_theme', 'clean').'"

 //$K2(window).load(function() {


Category BootstrapCategory CoffeescriptCategory DrupalCategory GravCategory HTMLCategory JavascriptCategory JoomlaCategory jQueryCategory LaravelCategory MagentoCategory PHPCategory SharePointCategory SpringCategory ThymeleafCategory WordPressCategory Workflow


Developed and designed by Netgloo
© 2019 Netgloo