WordPress API404 error generally comes when we try to post something and the URL couldn’t pass through. It will disable any post creation or update. or any settings updates. Also, this issue doesn’t let you toggle any Jetpack Setting due to a 404 Not Found Error. Basically any request apart from GET i.e POST, PUT doesn’t work. We can solve this problem easily by following any of the below two methods.

My Current Environment is

  • Oracle Cloud VM
  • Ubuntu 20.04 LTS
  • WebMin / Virtual Min Panel
  • Nginx Server
  • MySql and PHP 7.4
  • Cloudflare
  • WordPress

2 Ways to resolve WordPress API404 Error

1. WordPress API404 error solution using command line on server

  1. Login to your server and open Terminal window. You can also SSH into your server.
  2. Locate your nginx file for the webhost. Generally found at this location.
cd /etc/nginx/sites-available

3. Edit the file using any text editor

nano website_name.conf

4. Copy the below text just above other location parameters in the file

location / {
   index index.php index.html index.htm;
   try_files $uri $uri/ /index.php$is_args$args;
}

5. Reload Nginx configuration using the below command.

nginx -s reload

6. That’s it API404 issue should be resolved now, Verify it on WordPress.

2. WordPress API404 error solution using Webmin VirtualMin UI Nginx Config Changes

This can also be done using Webmin Virtualmin UI by editing the Nginx config directly and without using any single command.

  1. Go to WebMin > Servers > Nginx Webservers. Select Edit Configuration Files.
Webmin_virtualMin_UI_nginx_config
Webmin Nginx Web Server Config Screen

2. Select your website Nginx config file from the dropdown Editing Config File and add the above mentioned code like this.

Nginx Edit Configuration Screen on Webmin UI

3. Save the changes and Apply Nginx Configuration from the Web Server Config screen above.

4. Verify on WordPress, API404 Issue should be resolved now.

Related Posts

One thought on “WordPress API404 Error Solved

  1. Thank you so much! After a couple of days trying different workaround I finally found your article, the solution worked flawlessly. Kudos to you and your staff!!!!!!!

Leave a Reply

Your email address will not be published. Required fields are marked *