Wordpress 5.0.3 - "Updating failed" and "Publishing failed". Console log shows a 404 on /blog/wp-json/wp/v2/posts/1177/autosaves?_locale=user - wordpress

I updated Wordpress to the latest version (5.0.3). Now, any time I try to post I get a red message that says "Publishing failed". If I try to save a draft I get "Updating failed".
In console, I'm seeing
https://mydomain/com/blog/wp-json/wp/v2/posts/1177/autosaves?_locale=user 404
When I test the URL with /wp-json/wp/v2/posts/ I get a 404. If i use ?rest_route=/wp/v2/posts/ instead, I get my blog. I'm using Post name for permalinks.
Is there a way I can change the WordPress editor to use the rest route that is working? Or can I change something in my Nginx config?

two easy solutions:
You should deactivate the security plugin, in my case problem was with Advanced Access Manager plugin that I deactivate it and problem fixed.
Use the Classic Editor plugin By WordPress Contributors, just install this plugin and use the Classic editor, here is the setting that you can use both classic and block editor.
Setting->Writing->Allow users to switch editors
then in the create page, you have this option
For block editor => Switch to Classic Editor
And Classic editor => Switch to Block Editor

I changed my Permalink to Plain, then it's working, else it's throwing the same error!

I guess this has something to do with permalinks and how url is rewritten. once I change my permalinks option to plain everything seems fine. I'm using a local install with nginx. hopefully will find out why this happens later.

I had a similar problem with WordPress 5.2.2. I couldn't save or publish a page (new or old). Although all requests in the page editor return 200 I realized that some requests had a request domain of my site and others a request domain of the hosting company. So, I went to Settings > General and changed the settings Site Address (URL) and WordPress Address (URL) to be the same value (I copied the value of Site Address (URL) into WordPress Address (URL)) and that fixed the problem with the editor.

Step 1: Open the WordPress and login as administrator. When you post new content or older content you will be getting error message.
Step 2: So, now choose the older version of Editor of WordPress instead to use new version. To choose older version go to settings and then click on writings. Here you can find option "Classic Editor" and if you will not find option then choose second option.
This is one option but if you are not fixed with this option choose second option such as
Open the WordPress and on the left side you have list of tasks to be performed in WordPress. Click on the option “Plugin” and you will be opened with the plugin screen. On the top of the screen, you have the button “add new”.
Step 3: After clicking on the add new button, new screen will be opened. There, you can see classic editor plugin. Kindly, download and install it. Once it is installed, then activate it by clicking on the “activate” button.
Step 4: Again, go the Settings option and click on the Writing. In the Writing section, you have many options such as formatting, default post category, default post format, default editor for all users, allow users to switch editors, post via email etc.
Click on the classic editor choice in default editor for all users. This makes you to work easy on content posting newly or updating the previous contents.

With wp cli:
wp core update (get the latest version)
wp plugin update --all (why not update plug ins too)
wp plugin install classic-editor (get this)
wp plugin activate classic-editor (activate)

When we get 404 in wordpress pages and publishing failed there could be an issue with .htaccess file.
Update your Permalink settings and check .htaccess file, If .htaccess file is exist, and it's correct, confirm in your server .conf file have
Or your .htaccess file is not able to override server configuration
<Directory /var/www/web-app-wordpress>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
Restart apache server after updating this code.

Related

I am redirected to my site homepage when I login using mysite/wp-admin instead of getting to the wordpress admin page

I am getting redirected to my website homepage when I login to the admin area in Wordpress or I get an error message saying 'Sorry, you are not allowed to access this page'
I just migrated my website from one host provider to another using the All in One WP migration plugin. I was able to access the admin area but once the backup, I am either being redirected to my homepage or getting the above error when I try to login. I have already tried to create a new user with admin privileges, modified the wp-config and htaccess files and even updating and changing the prefixes of the database. I have also tried disabling the plugin and theme files and none of them seem to work.
I just want to be able to login to the admin area of my WordPress site.
In such cases the steps I follow to resolve this case are:
Set .htaccess with only the default WordPress redirect rules, which you can check here.
Set the default TwentyNineteen theme as active. Since you do not have access to your admin dashboard you can perform this change by altering the "template" and "stylesheet" rows in your application database which both are located in the "_options" table.
The other option is via SSH. From the WordPress root directory you can execute the following command, which will change the currently active theme to TwentyNineteen:
wp theme activate twentynineteen
NOTE: No matter which option you choose the TwentyNineteen theme should be installed. If you have other WordPress default theme installed rather than TwentyNineteen, you can switch to it.
Deactivate all of the plugins. This can also be performed in two ways without access to the admin dashboard. The first option is to rename the wp-content/plugins folder to:
wp-content/plugins-backup
The other option is once again via the WP CLI tool with the next command:
wp plugin deactivate --all
Another NOTE: In order to use the WP CLI tool, please note that the same should be installed on the server. If you write the command and the terminal respond is:
-bash: wp: command not found
Or something similar ending with "command not found" this means that the tool in question is not installed. In this case you will be unable to use the WP CLI tool or you can ask your hosting provider to install this tool for you.
In my experience with this issue, after all of these changes are performed the access to the admin dashboard is restored. If the issue still persist even after the changes are applied, I would recommend you to contact your current host provider in order to understand if they have any custom Web Application Firewall (WAF) rules, default plugins/optimizations that could cause such issue.

Wordpress Permalink issue on subdirectory wordpress

I have installed wordpress inside one folder called blog. when we open the blog, the blog links are broken 404 page error. How do i fix this issue, if its installed on root directory it will work, but this time it is directory, Is there any way to fix this issue
Normally such issues can be fixed easily by refreshing your permalinks. To do that go to WP > Settings > Permalinks and click on the save button once.
On some servers it is not allowed to edit .htaccess by clicking save in that section, therefore if you get an error; contact your hosting provider.
You may also want to check that the URL of your site corresponds to the URLs shown inside of WP > Settings > General.
First ensure your server support rewrite_ module
1.Login your WordPress dashboard
2. Click Settings
3.click Permalinks and change your permalink then click save

WordPress Visit Site is pointing to another URL

I am trying to repair a WordPress installation. I almost have it running now, but there is a strange issue.
In the admin dashboard there is an option in the upper menu to open the site, Visit Site.
When clicking this menu option, the browser opens another folder from the server, not the folder where WordPress is installed.
I have tried several options to solve the issue:
Adding
define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');
at the end of wp-config.php file. Of course changin yourdomain.com for the current domain.
Checking the database entries for siteurl and home in options table.
Checking inside Settings->General settings for WordPress Address and Site Address
Is there another way to get the reason for the issue?
I think there are a few other factors you are missing to mention in your question. I would add checking the server setup for that domain. Is it cPanel or Plesk? Take a look at what the domain is supposed to be vs what path is WP installed.
Other possibilities might be:
Server's cache
Your .htaccess file
Permalinks (disable and enable)

Wordpress permalinks not working on Webmin

I have a Webmin, which is CentOS server, for hosting Wordpress sites.
But my permalinks are not working. I have give a persmisions to Wordpress, so I can control permalinks from WP.
WP saves a configuration to .htaccess and also all link in my menu change to permalinks I choose, but ofter click on those links, I get "Not found" error.
If I switch WP back to no permalinks, everything works ok again.
Actually, I don't have any idea, what else can I try, and why this is not working. But I suppose there is some setting on the server itself, because, this is not working on any my site on this same server.
You need to check if your apache server has mod_rewrite extension enabled.
That extension is managed short/permalinks for websites like Wordpress.
You can check it by creating short file 'phpinfo.php' in the wordpress folder:
<?php
phpinfo();
?>
Navigate to the http://yourwebsite.com/phpinfo.php and look for the 'mod_rewrite' in the output.
If you can't find it you need to setup it first, take a look here.

wordpress page permalink is not working on local

I have wordpress website on server, created pages and that's working fine, but when I download wordpress files and DB on local and want to run with localhost, permalinks for pages are not working.
It seems this is an old post, but this might help others that encounter same error.
Select:
Apache –> Apache Modules –> and that will display the lists of available modules.
Now just check rewrite_module.
source from WordPress Custom Permalink not Working in Localhost
Hope that helps.
Sometimes when copying from one server to another, wordpress' permalinks goes a little screwy, try setting them back to default (using the admin panel) and then setting them again to your desired permalink structure (being sure to apply the changes each time).
you need to go into the database and change a few options.
Goto your phpmyadmin installation and navigate to wp-options table. Change the siteurl and home options to your localhost address.
Wordpress needs these database tries to build your permalinks. If they are wrong, then it will direct your links to incorrect locations.
You can simply fix this by doing the following:
Go to settings in your WordPress site.
click on permalinks ( You will see the URL structures of your newly configured WP site. (if it shows your original website values, go to settings-> general and set your local site URLs
Don't do any changes, just click on the Save button.
Refresh your local site and click on your page link or post.

Resources