Simple Captcha

Klub ships a lightweight captcha using php-simple-captcha and a dedicated endpoint. Use this page if you want a simple built-in challenge without third-party services.

Configuration

<?php

return [
  'bnomei.klub.captcha.set' => function () {
    $builder = new \SimpleCaptcha\Builder;
    $builder->bgColor = '#FFFFFF';
    $builder->lineColor = '#FFFFFF';
    $builder->textColor = '#000000';
    $builder->applyEffects = false;
    $builder->build();
    kirby()->session()->set('captcha', $builder->phrase);

    return ['captcha' => $builder->inline()];
  },
];

Render and validate

  1. Fetch the captcha image from GET /klub/captcha.
  2. Post the user input as captcha with your form.
  3. klub()->captcha() compares the response with the stored phrase.

Keep CSRF checks enabled even when using captcha.

Kirby Klub is not affiliated with the developers of Kirby CMS. We are merely standing on the shoulder of giants.
© 2026 Bruno Meilick All rights reserved.