A 405 Method Not Allowed error means your web server received the request but refused to process it because the request used an HTTP method (such as POST or GET) that isn't permitted for that particular page or resource. It's different from a 404: the page exists, but something is blocking the specific action you tried to perform, like submitting a form or calling an API endpoint.
Common causes
- A rule in your site's .htaccess file that restricts which HTTP methods a page or folder can accept.
- A contact form, checkout page, or custom script trying to POST data to a URL that only allows GET requests (or vice versa).
- A WordPress plugin or theme conflict, especially around the WordPress REST API or a caching plugin.
- A security setting or firewall rule on the server blocking a specific request method as a precaution.
- A broken redirect that sends a POST request (like a form submission) to a URL that then redirects it as a GET request, which some servers reject.
How to fix it
-
Confirm where the error happens. Note the exact page or action that triggers the 405 (a specific form, a login page, an API call) rather than your whole site. If your whole site is down, this is likely a different issue.
-
Check your .htaccess file. Open your site's file manager and look for a
.htaccessfile in your website's root folder. Look for lines containingLimit,LimitExcept, orRewriteRulestatements that mention specific HTTP methods. A rule added for a different purpose can accidentally block the method your form or script needs.Always download a copy of your existing .htaccess file before editing it. A single mistake in this file can take your entire website offline, and having a backup lets you undo the change immediately.
-
Comment out or remove the suspect rule. Add a
#at the start of the line to disable it temporarily, save the file, and reload the page that was failing. If the error disappears, you've found the cause and can adjust or remove that rule properly. -
If you're on WordPress, disable plugins one at a time. Security plugins, firewall plugins, and caching plugins are the most common culprits, particularly if the error appears on your login page, checkout page, or REST API endpoints. Deactivate them individually and retest after each one to isolate the problem.
-
Check for a broken form action or API URL. If a contact form or custom script is affected, confirm the form's action attribute or your script's request URL is correct and points to a page that actually accepts that method. A typo or an outdated URL is a common cause.
-
Clear your cache and test again. Both browser cache and any server-side caching (including a caching plugin) can serve an old, broken version of a page. Clear both before deciding whether your fix worked.
If none of these steps resolve it, the restriction may be set at the web server level rather than in a file you can edit yourself. In that case, reach out to your hosting provider's support with the exact URL and the action you were trying to perform (for example, submitting a specific form) so they can check the server configuration.
For more on how the .htaccess file works and what else you can safely change in it, see What Is a .htaccess File and What Can You Do With It?