𝗪𝗵𝘆 𝗖𝗼𝗻𝘁𝗮𝗰𝘁 𝗙𝗼𝗿𝗺 𝟳 𝗕𝗿𝗲𝗮𝗸𝘀 𝗼𝗻 𝗦𝘁𝗮𝘁𝗶𝗰 𝗦𝗶𝘁𝗲𝘀
You export your WordPress site to static HTML. Your contact form stops working. You see a 404 error in the console.
Contact Form 7 needs PHP. It uses a REST API to process data. Static sites have no PHP. No PHP means no REST API.
Some people blame CORS. A CORS header will not fix a missing server. You need a backend to handle the email.
If you use Simply Static Pro, check your file permissions. A missing JS file causes this error. Run this command:
chmod 644 /var/www/html/wp-content/plugins/simply-static-pro/assets/ssp-form-webhook-public.js
Run the export again.
Two ways to fix this:
- Keep WordPress on a subdomain. Use it as your API. Add CORS headers to your .htaccess file.
- Use a static form service. Try Formspree or Netlify Forms.
How to debug:
- Visit your WordPress URL followed by /wp-json/. If you see a 404, your backend is offline.
- Open DevTools. Submit your form. Look for 404 or CORS errors.
- Check your forms.json file. Ensure the endpoint points to your WordPress domain.
Stop treating symptoms. Fix your architecture.