Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Contact Form 7

Nonces and CSRF Protection in CF7 Addons

Protect custom admin/AJAX routes with nonces and capability checks.

Nonces and CSRF Protection in CF7 Addons — a practical guide to Contact Form 7 nonces CSRF with clear examples you can reuse in real projects.

Contact Form 7 Tutorial Series (91/100). Prefer one article? Read the complete Contact Form 7 tutorial.

Short description

CF7 forms include their own protections; your addon endpoints still need WordPress nonces.

Nonce check

check_ajax_referer('acme_cf7', 'nonce');
if (! current_user_can('manage_options')) {
    wp_send_json_error(null, 403);
}

Leave a reply

Your email address will not be published. Required fields are marked *