{"id":20,"date":"2024-11-13T07:05:00","date_gmt":"2024-11-13T14:05:00","guid":{"rendered":"https:\/\/kennebel.com\/blog\/?p=20"},"modified":"2024-11-12T14:12:16","modified_gmt":"2024-11-12T21:12:16","slug":"wordpress-error-the-response-is-not-a-valid-json-response","status":"publish","type":"post","link":"https:\/\/kennebel.com\/blog\/2024\/11\/13\/wordpress-error-the-response-is-not-a-valid-json-response\/","title":{"rendered":"WordPress error &#8220;The response is not a valid JSON response&#8221;"},"content":{"rendered":"\n<p>So, while installing WordPress on my server, ran across an error when trying to save page edits:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The response is not a valid JSON response<\/p>\n<\/blockquote>\n\n\n\n<p>All of the articles and help docs I could find online were unable to help. The reason is because the articles all presumed that you are running Apache for the web server. However, I am running NGINX, which requires a slightly different solution.<\/p>\n\n\n\n<p>From the following site: <a href=\"https:\/\/www.cyberciti.biz\/faq\/how-to-configure-nginx-for-wordpress-permalinks\/\">nixCraft<\/a>, found two tweaks to your \/etc\/nginx\/sites-available config file based on if WordPress is on the main domain\/subdomain or if you have it installed in a subfolder.<\/p>\n\n\n\n<p><strong>Domain\/Subdomain<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>location \/ {<br>            try_files $uri $uri\/ \/index.php?$args; <br>}<\/code><\/pre>\n\n\n\n<p><strong>Subfolder<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>location \/blog\/ {<br>            try_files $uri $uri\/ \/blog\/index.php?$args; <br>}<\/code><\/pre>\n\n\n\n<p>This REPLACES the portion you will find in other articles talking about .htaccess, as that is not in use with NGINX, but this change accomplishes the same thing.<\/p>\n\n\n\n<p>So if you hit the error that sounds like it has nothing to do with the fix, that is IT life. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, while installing WordPress on my server, ran across an error when trying to save page edits: The response is not a valid JSON response All of the articles and help docs I could find online were unable to help. The reason is because the articles all presumed that you are running Apache for the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,8],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-programming","category-technology"],"_links":{"self":[{"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":5,"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":39,"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions\/39"}],"wp:attachment":[{"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kennebel.com\/blog\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}