
You submit a form and the server answers 405 Method Not Allowed — the URL exists, but it refuses the HTTP method you used. The 405 Method Not Allowed fix is about matching the verb to the endpoint: the server (or the application behind it) only permits certain methods (GET, POST, PUT, DELETE…) on that path, and your request used one it does not allow. This 2026 guide shows you how to find which layer is refusing and fix it.
A typical story: a contact form POSTs to a URL that only accepts GET, or a plugin update sends PUT/DELETE requests that the server’s security rules block. The response usually includes an Allow header listing the permitted methods — read it first, because it tells you exactly what the server expects.
What Causes the 405 Error
- Form using the wrong method or action URL: a form POSTing to a plain page, or a GET where POST was intended.
- API route missing the verb: the endpoint registers GET but the client sends POST (or vice versa).
- Nginx blocking methods: a
limit_exceptblock restricting the location to GET/HEAD only. - Apache .htaccess rules:
<Limit>or<LimitExcept>containers denying methods. - WordPress plugin/theme conflict: rewrite rules or security plugins intercepting form submissions.
- CDN/WAF blocking: Cloudflare or Sucuri rules blocking PUT/DELETE as a security measure.
- CORS preflight failure: the browser’s OPTIONS preflight gets a 405, killing the real request before it starts.
How to Fix 405 Method Not Allowed: 8 Steps
Step 1: Read the Allow header
Open DevTools → Network, click the failed request, and read the Allow response header — it lists the methods the server accepts on that URL. Then check what method was actually sent. If the form should POST but sent GET, fix the form’s method="post" attribute and its action URL first.
Step 2: Test with curl
Reproduce it directly: curl -X POST -v https://yoursite.com/endpoint and curl -X OPTIONS https://yoursite.com/endpoint. The verbose output shows the Allow header and confirms whether the block is at the server layer (instant 405) or the application layer.
Step 3: Fix Nginx limit_except blocks
Search your Nginx site config for limit_except — a block like limit_except GET { deny all; } rejects every other method. Add the methods you need (limit_except GET POST PUT DELETE PATCH OPTIONS) or remove the block, then nginx -s reload. Also verify proxy_set_header lines forward Content-Type correctly in reverse-proxy setups.

Step 4: Fix Apache Limit/LimitExcept rules
Look for <Limit> or <LimitExcept> containers in .htaccess or the virtual host config wrapping the affected path. Adjust the enclosed access rules to include the required method, or replace them with modern Require directives. .htaccess changes apply immediately — no restart needed.
Step 5: Rule out WordPress plugin conflicts
On WordPress, rename wp-content/plugins to plugins.hold via FTP to deactivate everything, then test the form. If the 405 clears, reactivate plugins one by one. Also re-save Settings → Permalinks to rebuild rewrite rules — corrupted rules are a classic WordPress 405 cause.
Step 6: Regenerate .htaccess
Download a backup of .htaccess, then replace it with the default WordPress block and re-save permalinks. Re-add custom rules from the backup one section at a time, testing after each — the section that reintroduces the 405 is your culprit.
Step 7: Check the CDN/WAF layer
In Cloudflare, check Security → Events for a Block action on the failing path at the time of the error — WAF rules often block PUT/DELETE. Scope the rule to exclude your endpoint or adjust its sensitivity. Sucuri users should check Hardening settings for HTTP method restrictions.
Step 8: Fix CORS preflight
If an OPTIONS request returns 405, answer it properly: return Access-Control-Allow-Methods listing the real verb, Access-Control-Allow-Headers for custom headers, and Access-Control-Allow-Origin for the calling origin. Without a passing preflight, browsers never send the actual request. For auth-related failures instead, see our 401 Unauthorized fix.
How to Prevent 405 Errors
Design forms and APIs with the method contract explicit: document which verbs each endpoint accepts, test submissions on the production stack (dev servers behave differently), and keep server configs in version control so a limit_except never appears unreviewed. After any WAF or server migration, submit every form once. A quick form test with a free site testing tool after deployments catches method blocks early.
Conclusion
405 means the verb does not match the endpoint: read the Allow header, fix the form or route, check Nginx limit_except and Apache Limit blocks, rule out plugin conflicts, and clear the WAF. Match the method to what the server permits and the request goes through. For more HTTP-error fixes, keep reading the KamiWeb blog.
