1. Request Method Post Not Supported
  2. Web Service 405 Method Not Allowed

If someone comes across an error page on your site, there’s a good chance they’ll get annoyed and leave. This can result in plenty of lost engagement and sales. One particularly common error to be aware of is the “405 Method Not Allowed” message.

This error can be tricky to navigate, as it indicates that something has gone wrong without telling you why it occurred. Fortunately, with a little effort and patience, you can be back up and running before long.

This quick article is focused on a common error – ‘Request Method not Supported – 405' – that developers face while exposing their APIs for specific HTTP verbs, with Spring MVC. Naturally, we'll also discuss the common causes of this error. Type Status report. Message Request method 'POST' not supported. Description The specified HTTP method is not allowed for the requested resource. I am getting a 405 return code for POST request in wildfly 10 which is otherwise working on a jboss 5.0. When i deploy the same application on Wildfly, somehow Wildfly doesnt like the POST method I started logging the http requests in the unertow by using this post I started getting the http dumps like this. 405 Request method 'POST' not supported. Paloaltochico Apr 10, 2015 9:40 AM HI guys I was wondering, I can do.

In this post, we’ll explain what a 405 error is and show you the different ways it can appear. We’ll then talk you through some of the ways you can fix this error on your WordPress site. Let’s get to it!

What the 405 Method Not Allowed Error Is

When you manage a website, it’s almost guaranteed that you’ll run into some kind of common issue eventually. Websites go down, links break, and pages load a little too slowly. Although these occurrences are common, leaving them unattended is likely to result in a poor user experience.

Unfortunately, some problems are more difficult to fix than others. Consider the 405 Method Not Allowed error message, for example. This is an HTTP response status indicating that a web browser has requested access to one of your site’s pages.

In this scenario, your web server has received and recognized the request, but has rejected the specific HTTP method it’s using. In practical terms, this means that the browser can’t access the page it requested. Your site’s visitors will see an error page, rather than the content they were looking for:

Google Chrome

Safari

405 Not Allowed Error Nginx in Safari

Firefox

Microsoft Edge

405 Not Allowed Error Nginx in Microsoft Edge

The 405 Method Not Allowed error shouldn’t be confused with the 404 Not Found error. A 404 tells you that the requested URL couldn’t be found or that it was entered incorrectly. A 405 error message, on the other hand, confirms that the requested page does exist (and the URL was input correctly), but an unacceptable HTTP method was used to make the initial request.

405 Method Not Allowed (Short Definition):

Error 405 request method post not supported

The 405 Method Not Allowed error occurs when the web server is configured in a way that does not allow you to perform a specific action for a particular URL. It’s an HTTP response status code that indicates that the request method is known by the server but is not supported by the target resource.

Support

Variations on the 405 Method Not Allowed Error

Although the 405 error message most commonly appears in the form we showed above, various web servers, operating systems, and browsers can present it in numerous ways. The actual cause of the issue is also likely to differ slightly from server to server, which can affect the way the error appears.

Here are just a few of the many different variations you might run across:

  • 405 Not Allowed
  • Method Not Allowed
  • HTTP 405 Error
  • HTTP Error 405 – Method Not Allowed
  • HTTP 405 Method Not Allowed

Regardless of how they appear, the trouble with 405 errors is that they can be difficult to solve. This is because they let you know that something has gone wrong, but they don’t tell you what the cause of the problem is. In most cases, it’s up to you to find the root cause and repair it if possible.

How to fix the 405 Method Not Allowed Error on Your WordPress Site (7 Possible Solutions)

Before we start discussing the possible solutions, you’ll want to create a backup of your site. This will give you something to fall back on if you make a mistake. Many web hosting providers include regular site backups as a part of their plans. If you have a hosting plan here at Kinsta, creating a backup is simple.

Once that’s out of the way, it’s time to begin the troubleshooting process. The methods we’ve outlined below are organized from most likely to fix the problem to least likely, so start from the top and work your way down to achieve the best results.

Request Method Post Not Supported

Without further ado, let’s get started with one of the easier steps on our list.

1. Check to See If You’ve Input the Correct URL

It may sound a little too simple but the most common cause of a 405 Method Not Allowed error is entering the wrong URL. Most web servers are tightly secured and designed to disallow access to improper URLs to prevent users from visiting the wrong pages (or trying to access pages that don’t exist).

Before going any further, therefore, double-check to ensure that you’ve entered the URL of the site you wish to visit correctly. It’s easier than you might think to make mistakes – such as forgetting a letter or misspelling a word. You may also find that simply refreshing the page could prompt it to load correctly.

2. Roll Back Any Recent WordPress Updates

Updates are wonderful things. They typically bring a wealth of exciting new features and can help to fix any ongoing bugs and patch security holes. However, despite their good intentions, updates can occasionally cause some issues.

If you updated WordPress just before the 405 Method Not Allowed error message started to appear, the new code could be the root of the problem. This also applies to any extensions or themes you may have recently upgraded – although we’ll focus more on that aspect in the next section.

If you feel that an update might be at fault, it’s worth reverting back to the previous version of WordPress. As we’ve already touched on, make sure you have a full site backup ready before doing this – you don’t want to make any irreversible changes.

While you can do this manually, the easiest way to roll back WordPress updates is to use a plugin. There are many available options, although WP Downgrade is particularly effective. This plugin will largely automate the process, meaning that you’re less likely to make mistakes.

Having a tool like this in your arsenal also means that you can prevent similar issues from happening in the future. Of course, if rolling back the latest update doesn’t fix the problem, remember to re-update your site or restore your backup.

Minimize the potential for error with one unified management dashboard and site backups made simple (and accessible). Try Kinsta for Free.

3. Uninstall New Plugins and Themes

Plugins are an essential part of any WordPress website. They enable you to add a wealth of new features, and can even automate more complex processes. Themes are equally as important. Without them, you’d need a lot of complex coding (or an expensive developer) to create an aesthetically-pleasing site.

Unfortunately, just as with software updates, these extensions can sometimes create problems. This is because adding functionality to your site on any level completely changes the way it operates. There may be an issue with the plugin or theme you’re using, or a specific extension might conflict with another part of your site (or even your WordPress version).

As a result, you may find that uninstalling certain plugins or themes could help to fix the 405 Method Not Allowed error. To begin this process, you’ll need to navigate to the Plugins section of your WordPress dashboard. On this page, you should be able to see a complete list of all the plugins you have installed:

From here, you can begin to uninstall your plugins one at a time. After uninstalling each one, check your website to see if the error has been resolved. This process may take some time to complete, but it will enable you to pinpoint exactly which plugin is causing the problem (if any of them are at fault):

How to deactivate a WordPress plugin

Once you’ve checked over your plugins, you can repeat this process with your active theme. If your theme or one of your plugins turns out to be the issue, you’ll want to either contact the developers, remove the plugin or theme, or look for a replacement. Here’s our guide on how to install a new WordPress theme.

4. Check for Any Unexpected Database Changes

Web Service 405 Method Not Allowed

Although the above step should resolve any plugin- or theme-related issues, it doesn’t guarantee that all changes made by your extensions have been fully reverted. This is especially true for many WordPress plugins. They are often given complete access to your database as soon as you hit Install, meaning that their changes go deeper than you might initially think.

Unless the developer explicitly codes against it, a plugin may be able to modify database records that don’t “belong” to it but are instead managed by WordPress itself. In this scenario, the plugin may not know how to revert those alterations to database records, so it will ignore them during the uninstallation process.

Diagnosing this particular problem can be difficult, but if you still suspect that a plugin or theme is the cause of the 405 Method Not Allowed error, checking your database directly is your best course of action. To do that, you’ll need to open your site’s database, and manually look through the tables and records modified by the extension. If you’re not sure what to look for, getting in touch with your developer is a smart idea at this point (as well as for the remaining steps on this list).

5. Confirm Your Server’s Configuration

Your website likely runs on a server that uses one of the two most popular server software options – Apache or Nginx. In fact, together they power 84% of the world’s web servers. Checking your web server software’s configuration files for any unintentional handling instructions may help to determine the root cause of the 405 Method Not Allowed error.

To determine which application your web server is using, you’ll want to look out for a key file. For example, if your web server is running Apache, you should be able to find an .htaccess file within the root directory of your website’s file system.

When your application is on a shared host, you’ll likely have a username associated with your particular account. If that’s the case, the application root directory can typically be found by following this path:

/home/public_html/

Therefore, the .htaccess file would be found at:

/home/public_html/.htaccess

Once you’ve located the .htaccess file, open it up in a text editor and look for lines that use Rewrite directives. These are part of the mod_rewrite module in Apache and define a text-based pattern that will be matched against all entered URLs. If a matching URL is requested by a visitor to your site, the RewriteRule will redirect the visitor appropriately.

To better demonstrate this, here is a simple RewriteRule that matches all incoming requests to https://kinsta.com and responds with a 405 Method Not Allowed error code:

As you can probably see, there’s a flag at the end of the rule marked R=405. This explicitly states that the response code should be 405, indicating to the user that the resource exists, but the provided HTTP method was not allowed. If you find any strange Rewrite directives in the .htaccess file that contain a similar instruction, try temporarily commenting them out using the # character prefix. You can then restart your web server, to see if your change has resolved the issue.

Remember, if you’re a client at Kinsta, we use Nginx servers, not Apache. You can reach out to our support team if you think something might be wrong with your Nginx config.

6. Look Through the Server-Side Logs

Nearly every web application keeps some kind of server-side logs. Application logs usually comprise the complete history of everything the software has done – from the pages it’s requested, to the database results it provides.

Server logs are slightly different, as they’re related to the actual hardware that runs the application. They will often provide details about the health and status of all connected services, or even just the server itself.

To find your WordPress server logs, you’ll want to connect to your site via Secure File Transfer Protocol (SFTP). In the root directory, you will see a folder called logs. Within this folder are your access logs, and your WordPress error logs. They should look a little something like this:

  • Access.log
  • Error.log

From there, you can begin to follow a similar process to that outlined in the previous step. Look through the logs and take note of anything that looks out of place (or ask your developer to do so). You can also refer to the codex for additional debugging information in WordPress.

7. Debug Your Application Code or Scripts

If none of the previous steps have done the trick, it may be a sign that there’s an issue with some custom code in your WordPress installation. The only way of determining whether this is the cause of the 405 Method Not Allowed error is to debug it.

Ideally, you’ll want to make a copy of the entire installation to an online or local development area – such as a staging site. From there, you can begin to conduct a step-by-step debugging process, which will vary depending on your site and its attached software.

Unfortunately, there’s no quick fix here. You’ll have to be prepared to put in the time to comb each section of your site for anything that looks out of place. Remember, however, that a fully-operational site is worth the hassle.

What to Do if None of These Solutions Work

If you’re still reading, it probably means that the solutions we’ve outlined above still haven’t fixed the 405 Method Not Allowed error. This is usually an indication that a more complex issue has occurred, and is unlikely to be something you can fix personally unless you’re a seasoned developer.

In this scenario, the best thing you can do is often to contact your hosting provider directly. You should have access to 24/7 customer support through a live chat or ticketing service. You may also be able to reach out to your host via email or phone, although opting for live chat is likely to offer a faster solution.

Summary

No matter how carefully-optimized your website might be, it’s nearly inevitable that you’ll encounter at least one error message at some point. It’s important to resolve the issue quickly when this happens, to keep visitors interested in your site. Fortunately, although the 405 Method Not Allowed error can be confusing, it’s often possible to fix it with a little troubleshooting.

Let’s recap the seven methods you can try in order to fix a 405 error on your WordPress site:

  • Check to ensure that you’ve entered the correct URL into the address bar.
  • Roll back any recent WordPress updates, to distinguish whether that’s causing the issue.
  • Uninstall any new plugins or themes one at a time.
  • Ensure that there haven’t been any unexpected database changes.
  • Confirm your server’s configuration.
  • Look through the server-side logs stored by WordPress.
  • Attempt to debug your application code or scripts.
Allowed

Do you have any further questions about the 405 Method Not Allowed error? Or is there another commonly-encountered error message you’d like us to cover? Let us know in the comments section below!

If you enjoyed this article, then you’ll love Kinsta’s WordPress hosting platform. Turbocharge your website and get 24/7 support from our veteran WordPress team. Our Google Cloud powered infrastructure focuses on auto-scaling, performance, and security. Let us show you the Kinsta difference! Check out our plans

Web servers inform clients, like internet browsers for example, about the processing status of the submitted request with the help of HTTP status codes. So there are various codes that confirm the success or failure of a request – along with very specific messages. While some of these messages are encountered relatively frequently with daily use of the World Wide Web, the 405 (Method Not Allowed) error is one of the more rare error messages. In this article you’ll find out exactly what leads to this error message, and why solving the problem is the responsibility of the website operator.

Request method post not supported
  1. HTTP error 405: How to fix the problem

What’s behind the 405 HTTP error?

The Hypertext Transfer Protocol (HTTP for short) defines methods that indicate possible actions that can be performed on the contacted web server. For example, this includes the following methods:

  • GET: Retrieve information associated with a specific URL resource
  • HEAD: Retrieve header information linked with a URL resource
  • POST: Send data to the web server – for example, form data
  • PUT: Replace the data for a specific URL with new data transmitted by the client
  • DELETE: Delete the data behind the respective URL

In order to protect your privacy, the video will not load until you click on it.

The administrator can configure each web server so that the individual methods are either allowed or not allowed. For example, if there’s no interactive content on the website, it’s only logical that the POST method isn’t allowed, since the user has no options to enter their own data and send it to the server. Otherwise, the error message mentioned above with the status code 405 would appear, informing the browser and its user that the method is not allowed.

The exact wording of the 405 HTTP message varies from server to server. Here are some common phrases:

  • 405 Method Not Allowed
  • 405 Not Allowed
  • Method Not Allowed
  • HTTP 405 Error
  • HTTP Error 405 – Method Not Allowed
  • HTTP 405 Method Not Allowed
  • Error: 405 Method Not Allowed
  • 405 – HTTP verb used to access this page is not allowed
  • HTTP Status 405 – HTTP method GET is not supported by this URL

When does the 405 error occur?

We have already indicated that the 405 error is caused solely by a server-side problem. But since status code 405 technically belongs to the client error messages (codes with the pattern 4xx), this doesn’t seem to make sense. This contradiction is quickly solved, though: If, as a browser user, you forward a request to the webserver with an HTTP method that it doesn’t allow due to its configuration, the error lies on the client side from the server’s point of view – in this case, the client simply made a wrong request. The server isn’t aware when processing the request of the fact that you’re only interested in the website’s offer, for example, to fill out a contact form.

Three scenarios in particular can lead to a “Method Not Allowed” error message:

  • The ban of the corresponding HTTP method is due to a misconfiguration of web servers or software components that are supposed to perform the respective action for the desired URL resource.
  • The ban of the HTTP method is from the website operator – in most cases, for security reasons. The error lies in a URL resource of the web project in question, on the grounds that its programming requires its method to not be allowed.
  • The HTTP method is not allowed by the hosting provider of the website operator. This particularly occurs with the POST method, which is required for entering data and is blocked by some providers for security reasons when accessing HTML documents.

HTTP error 405: How to fix the problem

If you come across a web project that displays the 405 Not Allowed error message, you can hardly solve the problem yourself. While with other HTTP messages you can usually solve the problem using tricks like refreshing the page, restarting the router, or checking the proxy settings, these measures are useless against the 405 error. In this case, it makes sense to contact the responsible website operator or administrator to make the problem known or receive exact information about the causes.

If you yourself are responsible for the site that is displaying the 405 HTTP code to visitors, then the circumstances are of course different: Depending on the cause of the error message, you have several options for solving the problem. To avoid angering your users and/or being penalized by search engines, you should resolve the error as quickly as possible.

Solution 1: Enable HTTP methods

If you’re not sure of the cause of the “405 Method Not Allowed” message, you should always first look at the settings of the software components that are responsible for responding to HTTP requests. Typically, this is handled by the web server, but a pre-connected Proxy or HTTP handler (in ASP.NET web applications) could also be responsible for the problem if the method is simply not enabled. Since the different applications differ from each other in terms of configuration, you first have to find out how the activation or deactivation of the HTTP methods functions for each software.

For Apache web servers, enabled methods are specified with the help of the mod_allowmethods module, for example. This can be controlled using the AllowMethods directive in the <Location> containers, which are needed to specify settings for one or more desired URLs. One configuration that enables access to the resource as well as client-side data entry can be implemented with the following entry:

With older Apache versions, permitted HTTP methods are defined with the directives <Limit> and <LimitExcept>

Solution 2: Clean up the source code

If you’ve deliberately blocked an HTTP method, for example, to guarantee the safety of the website (common practice for the PUT method), but the client still triggers such a request to retrieve URL resources, this is often due to incorrect website programming. The requested page or element is therefore incorrectly linked with the method, which is why the 405 error is the logical consequence. The solution is to locate the problematic code in the corresponding HTML document and replace the entered code with the correct request method. If the server configurations and source code are reconciled, then there’s a high possibility that the 405 HTTP error will disappear from the browser window of your visitor.

Solution 3: Bypass the provider’s security barrier

As previously mentioned, the 405 error can also have the background that the corresponding HTTP methods for certain MIME types – like an HTML document, for example – have been disabled by the hosting provider for security reasons. In this case, you can of course contact your provider and ask for approval – but if this isn’t possible, there are tricks that allow you to use the method for your web project anyway.

You can deliver the website with a different MIME type available for the desired method to work around the barrier. POST, for example, is usually deactivated for HTML pages, while the method functions in PHP documents. If you change the extension type, for example, from index.html to index.php, there’s a good chance that you’ll have solved the “405 Method Not Allowed” problem.

In order to protect your privacy, the video will not load until you click on it.

A second trick is to implement the website that causes the HTTP error as the content of the displayed 405 error page. To do this, simply save the page in question in a separate directory and define this in the configuration file as the official 405 error message:

This solution does have the disadvantage, though, that all success page accesses for the page are classified and counted as errors, which complicates the statistical analysis.

Related articles