{"id":32090,"date":"2021-11-24T15:00:08","date_gmt":"2021-11-24T14:00:08","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=32090"},"modified":"2021-12-27T14:16:44","modified_gmt":"2021-12-27T13:16:44","slug":"fix-wordpress-publishing-failed-error","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/fix-wordpress-publishing-failed-error\/","title":{"rendered":"How to Fix the WordPress Update or Publishing Failed Error"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]Even though WordPress has long gone from being a blogging platform only, <strong>publishing or updating posts is still an important task<\/strong> for WordPress webmasters, editors, or authors, regardless of the website\u2019s niche. Therefore, the inability to update or publish WordPress posts can greatly obstruct their workflow, especially if it happens for no apparent reason.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In this article, <strong>we will explain the reasons why such an error has been appearing recently.<\/strong> It is accompanied by error screens stating \u201cUpdate failed\u201d or \u201cPublishing failed\u201d, which cause a lot of frustration since they tell little about the cause of the error. Nevertheless, this error has a rather straightforward troubleshooting process, which we will outline in this article. Here is what we will be covering:[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#why-does-the-wordpress-update-or-publishing-failed-error-happen\">Why Does the WordPress Update or Publishing Failed Error Happen<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#initial-troubleshooting\">Initial Troubleshooting<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#checking-the-rest-api-status\">Checking the REST API status<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#disabling-wordpress-plugins\">Disabling WordPress Plugins<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#checking-the-firewall-settings\">Checking the Firewall Settings<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#reviewing-the-debug-log\">Reviewing the Debug Log<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#using-the-classic-editor\">Using the Classic Editor<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#asking-your-hosting-provider-for-help\">Asking Your Hosting Provider for Help<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-top-picks-banner&#8221;][vc_empty_space height=&#8221;80px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"why-does-the-wordpress-update-or-publishing-failed-error-happen\"><\/a>Why Does the WordPress Update or Publishing Failed Error Happen<\/h2>\n<p>[\/vc_column_text][vc_column_text]As mentioned above, the name of this error comes from the messages which appear when the error occurs. More precisely, while trying to publish a post using the Gutenberg editor, you might see the \u201cPublishing failed\u201d error message, while after editing an already published post, the error message \u201cUpdate failed\u201d might appear on the screen after clicking the Update button.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Publishing-Failed.jpg\" class=\"attachment-full size-full\" alt=\"Publishing Failed\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Publishing-Failed.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Publishing-Failed-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Publishing-Failed-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Publishing-Failed-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;60px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Updating-Failed.jpg\" class=\"attachment-full size-full\" alt=\"Updating Failed\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Updating-Failed.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Updating-Failed-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Updating-Failed-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Updating-Failed-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]And, while there are many possible reasons as to why these two possible variations of the error occur, they are all directly tied to how Gutenberg functions. Specifically, it is because<strong> the Gutenberg plugin relies on REST API to publish and update posts<\/strong>. Let us briefly touch on what REST API is.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Simply put, the WordPress REST API (Representational State Transfer Application Programming Interface) is<strong> a highly standardized communication protocol between WordPress and other web systems<\/strong> which ensures that they all understand each other properly. Therefore, this greatly broadens the spectrum of web-based applications that WordPress can interact with, transforming it into much more than a simple content management system (CMS).[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]This functionality was previously part of WordPress.com or was available as a separate plugin, but has been integrated into the WordPress Core with the introduction of Gutenberg as the default WordPress editor in the WordPress 5.0 update.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Therefore,<strong> if the connection with the REST API has been lost, blocked, or purposefully disabled, you will not be able to publish and update<\/strong> your WordPress posts using the Gutenberg editor. The reasons for breaking the connection between WordPress and REST API include faulty internet connections, firewall settings, faulty WordPress plugins or their settings, and others.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Having explained why the error happens, let us go into the troubleshooting methods needed to solve it. We have sorted them into several subsections, starting from the ones easiest to implement. Furthermore, we have also included an alternative way of solving the issue, in case you are unsuccessful in resolving the error using our other suggestions. With that said, let us proceed.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"initial-troubleshooting\"><\/a>Initial Troubleshooting<\/h2>\n<p>[\/vc_column_text][vc_column_text]Before we really get into troubleshooting, we suggest<strong> double-checking whether the issue is persistent or if it was only temporary<\/strong>. After verifying that the issue hasn\u2019t been resolved on its own, it is good to test certain specific reasons which could lead to the error. We will cover them in this section.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\">Checking the Internet Connection<\/h3>\n<p>[\/vc_column_text][vc_column_text]The most obvious reason as to why you might be seeing the Update or Publishing failed error is lack of internet connection, which is needed to connect to the REST API if you are working in a non-local environment.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>Make sure that you have a stable internet connection<\/strong> by accessing other websites in new browser tabs. After having made sure that any issue with the internet connection has been rectified, try to publish\/update the post once more to test if the error has been resolved.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\">Checking the Site URL<\/h3>\n<p>[\/vc_column_text][vc_column_text]Another obvious reason why REST API might have issues connecting to your website is when<strong> your website URLs aren\u2019t properly updated<\/strong> to reflect their current values. Of course, we are referring to the WordPress Address and Site Address found in Settings &gt; General. It doesn\u2019t hurt to verify whether they are properly set or update them if they aren\u2019t to see if the issue disappears afterward.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To do that, <strong>navigate to Settings &gt; General and locate the WordPress Address and Site Address options<\/strong>. These addresses represent the location of your WordPress files and the URL that the visitors have to type into their address field in order to access your website, respectively. <strong>Make sure that they are both correct.<\/strong> If they aren\u2019t, edit them so that they show the correct addresses. Click the \u201cSave Changes\u201d button to apply any changes.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"544\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/General-Settings-Addresses.jpg\" class=\"attachment-full size-full\" alt=\"General Settings Addresses\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/General-Settings-Addresses.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/General-Settings-Addresses-300x168.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/General-Settings-Addresses-768x431.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/General-Settings-Addresses-620x348.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>After editing the addresses, you will need to relog into the website using your credentials.<\/strong> Then,<strong> test the status of the issue<\/strong> by publishing\/updating a post.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\">Saving Permalinks<\/h3>\n<p>[\/vc_column_text][vc_column_text]Sometimes, the issue could be a corrupt <em>.htaccess<\/em> file. To test quickly if this is the case, you can simply <strong>update the permalink structure<\/strong> which will recreate the default <em>.htaccess<\/em> file.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To do so, <strong>navigate to Settings &gt; Permalinks<\/strong> and <strong>click the \u201cSave Changes\u201d button<\/strong> at the bottom.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"700\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Permalink-Settings.jpg\" class=\"attachment-full size-full\" alt=\"Permalink Settings\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Permalink-Settings.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Permalink-Settings-300x217.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Permalink-Settings-768x555.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Permalink-Settings-620x448.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Then, <strong>review the status of the issue<\/strong>. If it persists, proceed below. Additionally, we need to mention that <strong>saving permalinks is also recommended after <a href=\"#disabling-wordpress-plugins\">disabling WordPress plugins<\/a><\/strong>. As some plugins add rewrite rules to the <em>.htaccess<\/em> file, making sure that the file is recreated in its default state will ensure that the troubleshooting is thorough.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"checking-the-rest-api-status\"><\/a>Checking the REST API Status<\/h2>\n<p>[\/vc_column_text][vc_column_text]Since we already mentioned that the main reason for this error is a <strong>problem in the connectivity with the REST API<\/strong>, it comes as no surprise that one of the first troubleshooting steps is to<strong> check whether the REST API has experienced any issues or has been disabled<\/strong>. Even though this may seem difficult to check, there is an easy way of doing so by using the Site Health tool introduced in the WordPress 5.2 update.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To do so, <strong>navigate to the Tools &gt; Site Health section<\/strong> and <strong>open the Status tab<\/strong>. There, you can see all the suggested improvements for your website. Specifically,<strong> if the REST API is experiencing any issues<\/strong> or if it is disabled on your website, <strong>you will see a message stating \u201cThe REST API encountered an unexpected result\u201d.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"571\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/REST-API-Site-Health.jpg\" class=\"attachment-full size-full\" alt=\"REST API Site Health\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/REST-API-Site-Health.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/REST-API-Site-Health-300x177.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/REST-API-Site-Health-768x453.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/REST-API-Site-Health-620x365.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Clicking on that error message will reveal more information regarding the issue.<\/strong> You should inspect it to figure out how you can solve the issue. In most cases, it could be due to faulty code or third-party service settings, which you can pinpoint and resolve. But, in case you don\u2019t see an error message, proceed below to the remaining troubleshooting steps.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"disabling-wordpress-plugins\"><\/a>Disabling WordPress Plugins<\/h2>\n<p>[\/vc_column_text][vc_column_text]A very common reason for the Update or Publishing failed error are <strong>misconfigurations in the settings of certain plugins<\/strong>. Caching, website optimization, or website security plugins are commonly among the culprits, as some of them offer a way to disable REST API, while others might block the connection using various security restrictions. Whatever the case, the best way of figuring out whether one of your plugins is behind the error is to <strong>disable them and inspect the status of the issue<\/strong>. We will explain how you can do it properly below.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]First, <strong>navigate to Plugins &gt; Installed Plugins<\/strong> and <strong>tick the checkbox at the top<\/strong> to select all the plugins. Then,<strong> select the Deactivate option<\/strong> from the Bulk Actions dropdown and <strong>press the \u201cApply\u201d button<\/strong> to deactivate all the plugins.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"622\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Disabling-Plugins-Bulk-Action.jpg\" class=\"attachment-full size-full\" alt=\"Disabling Plugins Bulk Action\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Disabling-Plugins-Bulk-Action.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Disabling-Plugins-Bulk-Action-300x193.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Disabling-Plugins-Bulk-Action-768x493.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Disabling-Plugins-Bulk-Action-620x398.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Having deactivated the plugins, <strong>try to publish or update a post you previously weren\u2019t able to<\/strong>. If you can publish\/update the post at this point, it means that the issue was caused by one of your plugins. To pinpoint which one, try to activate the plugins one at a time and, then, test the status of the issue afterward.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If the issue reappears, the plugin you last activated is the culprit. If that is the case, <strong>to solve the issue completely, we advise consulting the plugin authors<\/strong>. On the other hand, if the issue has persisted after deactivating all WordPress plugins you have on the website, then you should proceed to the remaining troubleshooting steps, as the fault does not lie in any of your plugins.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"checking-the-firewall-settings\"><\/a>Checking the Firewall Settings<\/h2>\n<p>[\/vc_column_text][vc_column_text]Website firewall services like Cloudflare or Sucuri and certain <a href=\"https:\/\/qodeinteractive.com\/magazine\/best-firewall-plugins-for-wordpress\/\">WordPress firewall plugins<\/a> can also be the culprit for this error. Specifically, <strong>certain strict firewall rules could be blocking legitimate REST API requests<\/strong>, misinterpreting the URLs as a possible DDOS attack on your website. To test this, you can temporarily disable your firewall service or plugin and check the status of the issue. If the issue is resolved, it means some of the rules of your firewall service or plugin are to blame.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]This means that you need to <strong>inspect all the firewall rules<\/strong> set within the relevant dashboard or plugin options, respectively. To pinpoint the exact rule(s) you need to disable, we advise <strong>consulting the firewall service\/plugin support<\/strong>. On the other hand, if the issue persists even after disabling the firewall, proceed to the subsequent methods.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"reviewing-the-debug-log\"><\/a>Reviewing the Debug Log<\/h2>\n<p>[\/vc_column_text][vc_column_text]Even though WordPress doesn\u2019t keep track of REST API errors,<strong> it has a debugging system<\/strong> which <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-turn-on-error-logs-in-wordpress\/\">logs all WordPress coding-related errors<\/a>. And, as the issue can be related to a faulty code snippet, it is worth enabling this debugging system to inspect if this is the case on your end.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To do so,<strong> connect to your server<\/strong> using your FTP credentials first. <strong>Navigate to the root WordPress directory<\/strong> and <strong>locate the wp-config.php file<\/strong> within.<strong> Right-click the file<\/strong> and <strong>click on the \u201cView\/Edit\u201d option<\/strong> from the menu that appears.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"700\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-WP-Config-View-Edit.jpg\" class=\"attachment-full size-full\" alt=\"Debug WP Config View Edit\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-WP-Config-View-Edit.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-WP-Config-View-Edit-300x217.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-WP-Config-View-Edit-768x555.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-WP-Config-View-Edit-620x448.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Open the file<\/strong> using your preferred file editor and<strong> locate the comment section that mentions the WordPress debugging mode.<\/strong> After it, <strong>add the following two lines of code:<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">define( 'WP_DEBUG', true );\r\ndefine( 'WP_DEBUG_LOG', true );<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]as shown in the screenshot below.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"659\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Codes.jpg\" class=\"attachment-full size-full\" alt=\"Debug Codes\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Codes.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Codes-300x204.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Codes-768x522.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Codes-620x422.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]In most cases, <strong>the first line will already be present<\/strong>, but the value of the WP_DEBUG constant <strong>will be set to false<\/strong>. You only need to <strong>set it to true and insert the second code line afterward.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]The first line of code <strong>enables the WordPress error logging on the server<\/strong>, while the second <strong>specifies that the errors should be logged at a predefined location<\/strong> \u2013 the<em> wp-content\/debug.log<\/em> file. For additional debugging settings, we advise consulting our article on <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-edit-wp-config-file\/\">editing the wp-config.php file<\/a> and possible configurations you can implement.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]That done, you should <strong>navigate to the wp-content folder<\/strong> and <strong>locate the debug.log file. Right-click on it<\/strong> and<strong> select the \u201cDownload\u201d option<\/strong> to download it to your computer.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"700\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Download.jpg\" class=\"attachment-full size-full\" alt=\"Debug Download\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Download.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Download-300x217.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Download-768x555.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Debug-Download-620x448.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Then, <strong>open the <em>debug.log<\/em><\/strong> using your preferred text editor and<strong> investigate the error messages<\/strong> shown, especially <strong>their respective file paths<\/strong>. If any point to your theme or some of your plugins, then addressing their respective authors for help is advised. We also advise attaching your <em>debug.log<\/em> file when asking for help, as it will speed up the resolution process.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]And, once you have successfully resolved the issue, you can<strong> disable error logging by removing the second code line and resetting the WP_DEBUG constant to false<\/strong>. Conversely, if you weren\u2019t able to solve the issue, consider using some of our other troubleshooting methods below.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"using-the-classic-editor\"><\/a>Using the Classic Editor<\/h2>\n<p>[\/vc_column_text][vc_column_text]A potential way of solving the Update or Publishing failed error is to<strong> revert to the TinyMCE editor<\/strong> instead of Gutenberg. This change can be both temporary, as you keep searching for the resolution of your issue, and permanent, if you are more accustomed to the old editor anyway.You can enable the Classic Editor by installing the <a href=\"https:\/\/wordpress.org\/plugins\/classic-editor\/\" target=\"_blank\" rel=\"noopener\">Classic Editor<\/a> plugin.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you opt for this step, <strong>navigate to Plugins &gt; Add New<\/strong> and<strong> look for the Classic Editor in the Featured section<\/strong>. You can also use the search feature to help you find it. Having found the plugin, <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-install-a-wordpress-plugin\/\">install and activate it<\/a>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"467\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Install-Classic-Editor.jpg\" class=\"attachment-full size-full\" alt=\"Install Classic Editor\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Install-Classic-Editor.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Install-Classic-Editor-300x145.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Install-Classic-Editor-768x370.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Install-Classic-Editor-620x299.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This will <strong>enable the TinyMCE editor<\/strong> which doesn\u2019t rely on the REST API to work properly. Therefore, you will be able to edit or publish your posts.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"455\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Classic-Editor-Backend.jpg\" class=\"attachment-full size-full\" alt=\"Classic Editor Backend\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Classic-Editor-Backend.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Classic-Editor-Backend-300x141.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Classic-Editor-Backend-768x361.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/11\/Classic-Editor-Backend-620x291.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]As we have mentioned, you can use this as a way of solving the issue, or as a temporary measure while you look for the root of the initial problem.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"asking-your-hosting-provider-for-help\"><\/a>Asking Your Hosting Provider for Help<\/h2>\n<p>[\/vc_column_text][vc_column_text]Finally, if you weren\u2019t able to solve the issue using the aforementioned steps, you probably need professional help. <strong>Consulting with your hosting provider<\/strong> is often a good idea, as the issue could be due to a server settings misconfiguration, which they will be quick to figure out. Furthermore, they can provide you with the error logs to help you <strong>pinpoint the exact file and code line causing the error<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Then, if the error is caused by custom code you have added, you will be able to edit or remove it accordingly. And in the case the faulty file is part of a plugin, you can address the plugin authors for help, as previously suggested.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Final Thoughts<\/h2>\n<p>[\/vc_column_text][vc_column_text]The WordPress Update or Publishing failed error can be quite a nuisance to solve for most inexperienced WordPress users as it disallows creating new posts or editing existing ones for no apparent reason. However, troubleshooting it is relatively easy by following the steps we have carefully outlined in this article. These include checking the internet connection, website URLs, and permalinks, checking the status of the REST API and the firewall settings, disabling WordPress plugins, examining the error log, and asking your hosting provider for help.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Additionally, we have suggested you use the Classic Editor as an alternative solution to this issue. Given how straightforward our suggestions are, we are sure you will be able to solve this issue and regain control over your publishing and editing process. However, as the issue is a possible threat for any Gutenberg-using website, we advise bookmarking this article for future use.<br \/>\n[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Is your WordPress website plagued by the update or publishing failed error? We will show you how to fix it!<\/p>\n","protected":false},"author":11229,"featured_media":32142,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[4,52,13],"class_list":["post-32090","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-tips","tag-troubleshooting","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/32090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/11229"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=32090"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/32090\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/32142"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=32090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=32090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=32090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}