A lightweight contact form plugin without jQuery
A light contact form loads its stylesheet and script only on pages that actually show a form, doesn't need jQuery, and doesn't put a CAPTCHA script on every page. Many popular plugins do all three on every page of the site — which is why removing a form plugin is a common speed tip.
Where the weight comes from
- Assets on every page. Contact Form 7 adds its script and stylesheet site-wide unless you add code to stop it.
- jQuery. Older form scripts depend on it, so a page that otherwise needs no jQuery loads it for the form.
- A CAPTCHA script everywhere. reCAPTCHA in particular is heavy, and with CF7 it loads on every page when enabled.
- Work on every request, such as checking folders or options, even when no form is involved.
How Mailbag is built
Mailbag Contact Form registers its stylesheet and script but only adds them to a page when the Mailbag Form block or the [mailbag] shortcode is drawn there. The script is plain JavaScript with no jQuery, loaded deferred in the footer. A CAPTCHA, if you enable one, follows the same rule. Pages without a form get nothing from Mailbag at all.
On the server, forms and entries live in two tables of Mailbag's own rather than in wp_posts, and it adds just one small automatically-loaded option to every request: the number that tells it whether its tables are up to date. There's no WP-Cron job; housekeeping such as deleting old entries runs when an administrator is in the dashboard or after a form is sent, at most every 12 hours.
How to check any plugin
- Open a page with no form, view its source, and search for the plugin's name: nothing should come up.
- In the browser's network panel, check whether jQuery is loaded on your form page and, if so, why.
- With a CAPTCHA enabled, check a page without a form: no google.com, hcaptcha.com or cloudflare.com script should appear.
Mailbag Contact Form is a free contact form that saves every entry before it sends anything, and shows you what happened to each email.
See what it does