Skip to content
StaticScope
Overview
Get StaticScope

Forms on a static site

Use the Forms add-on to send submissions to Web3Forms, Netlify Forms or your own endpoint, with inline feedback and no WordPress in the loop.

Features Updated 20 November 2026 8 min read

A static file cannot process a form. There is no PHP to read the POST, no database to store it and no admin-ajax to answer it. The Forms add-on gets around that by rendering a normal HTML form whose action points at a service that does the processing.

WordPress is not involved when someone submits. There are no entries in the database, no notification email and no admin list of messages. The add-on handles the markup, the provider settings and a report of the last build.

Choose a provider

Open StaticScope → Forms and choose where submissions should go. All three choices produce the same block, so you can switch later, but the provider is site-wide: every form changes on the next build.

ProviderWhere it worksWhat it needs
Web3FormsAny hostA free account and a public access key
Netlify FormsSites deployed on NetlifyA Netlify deploy. No key
Custom endpointAny hostYour own address that accepts a POST

Web3Forms is the default recommendation: it works on any host and needs one field. Netlify Forms is least work if the site is already there. A custom endpoint is for a Worker, Lambda or API you control.

The setup fields

The screen and its actions require manage_options, so only administrators can change the provider. Settings live in one option, staticscope_forms_settings, which is not autoloaded.

FieldShown forRules
ProviderAllWeb3Forms, Netlify or Custom endpoint
Access keyWeb3FormsRequired. 8 to 100 letters, numbers, underscores or hyphens
Email subjectWeb3Forms, CustomUp to 200 characters. Blank uses “New message from <site name>”
From nameWeb3FormsUp to 120 characters. Blank uses the site name
Endpoint URLCustomRequired full http or https address, with a host and no username or password
Success pageAllOptional full address, or a path starting with /. No protocol-relative // and no control characters
Extra hidden fieldsCustomOne name=value per line. Names allow letters, numbers, underscores and hyphens, up to 64 characters. Values up to 500 characters

Extra hidden fields cannot use the names the form adds itself: form-name, access_key, redirect, botcheck, bot-field or _gotcha. A malformed line is reported with its line number rather than being dropped silently.

Four constants override the saved values: STATICSCOPE_FORMS_PROVIDER, STATICSCOPE_FORMS_WEB3FORMS_KEY, STATICSCOPE_FORMS_ENDPOINT and STATICSCOPE_FORMS_SUCCESS_URL. A value in wp-config.php wins, so change it in the file, not on this screen.

The access key is public

The Web3Forms access key is a public form identifier, not an API key. It acts as an alias for the inbox that receives submissions and is safe to leave in the page source. The separate Submissions API key, the one starting w3f_live_, is secret and has no place in this setting.

Never paste the secret key. If a key starts w3f_live_ it is the Submissions API key. It gives read access to submissions and must not be put in a page, a form or this setting.

Put a form on a page

Add the Form block, or insert one of three patterns: Contact form, Email sign-up or Waitlist. The block settings cover fields, stacked or inline layout, labels, button style and label, send label and the success, error and validation text. An optional dropdown adds a question with your own choices.

Every form has a name, sanitised with sanitize_key and defaulting to contact. Keep it unique on the page: two forms with the same name confuse Netlify and make the build report ambiguous. An email field is always included.

What the markup looks like

The rendered form is plain HTML. It carries data-staticscope-form with the form name, data-staticscope-provider and data-staticscope-ajax-url for the script. There are no WordPress nonces and no admin-ajax call, because neither exists once the page is static.

ProviderActionHidden fieldsSpam trap
Web3Formshttps://api.web3forms.com/submitform-name, access_key, from_name, subject, redirectbotcheck
NetlifyThe success page, or the current page when blankform-name, subjectbot-field, with netlify-honeypot
CustomThe endpointform-name, your extra fields, redirect, subject_gotcha

The subject field is only added when the form has no visible Subject field, and redirect only when a success page is set.

URL rewriting would otherwise point the endpoint at the published site. The add-on protects an action, an AJAX URL and a hidden redirect input by replacing them with base64 tokens while links are rewritten, then restoring them. That protection is markup-based: it only applies to a form carrying data-staticscope-form. A form from another plugin is left alone, and may be rewritten or reported as third-party.

Success, errors and the success page

With JavaScript, the script checks the required fields, email addresses and any dropdown before sending. The button gets aria-disabled, shows a spinner and the status region says “Sending…”. The reply appears in the form: by default “Thank you. Your message has been sent.” or “Something went wrong. Please try again.” A success also resets the fields.

A response counts as success when it is OK and its JSON does not say "success": false. A JSON message or error replaces the form’s own text. The request is aborted after 20 seconds, and a failed request falls back to the form’s error message.

Without JavaScript, the browser validates and posts normally to the provider. The success page is used only in this case. When it is blank, the provider’s own page is used. With JavaScript the per-form “After sending” message wins, so the success page is not a second confirmation for the same submission.

In the editor the form is inert: you can select it but not type in it. It previews before a provider is configured, so you can design first.

Spam and privacy

Every form has a honeypot field, hidden with CSS and marked aria-hidden. Web3Forms and Netlify add their own filtering on top. A custom endpoint owns all of it: validation, rate limiting, spam checks and storage. The add-on sends the fields as plain text and does not escape them again at submission time.

Name the provider in your privacy policy and collect only what you need. The endpoint is saved in plain text, even though the screen treats it as sensitive because it may contain a token.

Test the setup

Use the test button. For Web3Forms it posts a fixed test message and needs a 2xx answer with a success marker. You should see “Test sent. Check the inbox for the email tied to that access key.” A refusal shows the service’s own message; a transport failure says “The test couldn’t be sent” with the error.

A custom endpoint receives a form-encoded POST with _test=1 and your extra fields. A 2xx reports “Test sent. The endpoint answered with HTTP <code>”; anything else shows the code and a short body excerpt. Netlify has no remote test: publish the site, send the form and look under Netlify → Forms.

Saving failures are reported as “Those details need a little attention.” and the field errors below it. If the settings were already working, a failed save says “Those settings weren’t saved. Check the details below.” Removing the connection deletes the settings and report, and leaves the blocks in place showing an unconfigured message.

The build report

When a build finishes, the add-on collects up to 200 forms and stores the first 100 with the build time and provider. The table shows the page path, the form name and one of three statuses: “Connected to <provider>”, “Provider not set up” or “Not a StaticScope form”.

Search forms, anything with a field named s and forms containing wp-login, wp-admin, admin-ajax.php, a log field or a pwd field are ignored. Other plugins’ forms are listed as third-party with a link to the pages. If the provider changed after the build, the report says which one the build used and asks you to build again.

Who sees what

If no provider is configured, an administrator viewing the front end sees “This form isn’t connected yet” with a link to the setup screen. Visitors see “This form isn’t available yet.” The setup screen, including test and remove, is administrator-only.

WP-CLI

wp staticscope forms status
wp staticscope forms test
wp staticscope forms list

status prints the provider, whether it is ready, how many forms the last build found and when. It warns rather than fails when forms are not set up. test runs the same test as the screen; an error exits non-zero, a warning does not. list prints the last build’s pages, form names and statuses, or says no forms were found.

Hooks

PHP filters: staticscope_forms_fields adds or changes the fields a form can show, staticscope_forms_attributes changes block attributes before rendering, staticscope_forms_provider changes the action, AJAX URL, hidden fields, form attributes or honeypot for one form, staticscope_forms_form_attributes changes the form tag, staticscope_forms_hidden_fields adds or removes hidden fields, staticscope_forms_field_html replaces one field’s markup and staticscope_forms_html changes the finished HTML.

In the browser, wp.hooks filters cover staticscopeForms.validationErrors, requestBody, requestOptions, successMessage and errorMessage, with an afterSubmit action. The inline script only knows the built-in field types, so a field added by a filter needs its own validation if it needs any.

Limitations

  • One provider for the whole site. Changing it needs a rebuild before the published forms use it.
  • No submissions are stored in WordPress and no email is sent by it. There is no entries screen.
  • The success page is a no-JavaScript fallback. With JavaScript you get the inline message, not both.
  • The build report describes the last build, so it can be stale after a provider or markup change.
  • URL protection only covers forms with data-staticscope-form; third-party forms are outside it.
  • Netlify only finds a form in deployed HTML, so a new form needs a publish before it appears under Netlify → Forms.
  • The endpoint is stored unencrypted. A custom endpoint does its own validation, rate limiting and spam filtering.
  • Uninstall removes the settings and the report only. Pages and blocks stay, and render the unconfigured message.

Next