I am using wordpress 5.4.2. I get this error when trying to add a new post. I changed my permalink to
Post name sample
http://localhost/wordpress/sample-post/
How should i change my .htaccess
My current htaccess is
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
~
Please help me II am new to wordpress
Akismet Anti-Spam Classic Editor Hello Dolly Increase Maximum Upload File Size Jetpack by WordPress myStickymenu OptinMonster API UberMenu 3 - The Ultimate WordPress Mega Menu .These are my installed plugins
This is my custom css
.site-info {
display: none;
}
.entry-meta .byline, .entry-meta .cat-links { display: none; }
.entry-meta .posted-on { display: none; }
.entry-footer{
display:none;
}
.postmetadata {display:none;}
.entry-meta {display:none !important;}
.home .entry-meta { display: none; }
.entry-footer {display:none !important;}
.home .entry-footer { display: none; }
Console error
[DOM] Found 2 elements with non-unique id #_wpnonce: (More info: https:// goo.gl/9p2vKq) <input type="hidden" id="_wpnonce" name="_wpnonce" value="65e17e3128"> <input type="hidden" id="_wpnonce" name="_wpnonce" value="2ba7a6de71">
/wordpress/wp-json/wp/v2/users/me?_locale=user:1 Failed to load resource: the server responded with a status of 404 (Not Found)
data.min.js?ver=e80048e7b309581a40e44b8bd8aaba41:2 Uncaught (in promise) Objectcode: "invalid_json"message: "The response is not a valid JSON response."__proto__: Object
I am using wordpress 5.4.2. I get this error when trying to add a new post. I changed my permalink to
Post name sample
http://localhost/wordpress/sample-post/
How should i change my .htaccess
My current htaccess is
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
~
Please help me II am new to wordpress
Akismet Anti-Spam Classic Editor Hello Dolly Increase Maximum Upload File Size Jetpack by WordPress.com myStickymenu OptinMonster API UberMenu 3 - The Ultimate WordPress Mega Menu .These are my installed plugins
This is my custom css
.site-info {
display: none;
}
.entry-meta .byline, .entry-meta .cat-links { display: none; }
.entry-meta .posted-on { display: none; }
.entry-footer{
display:none;
}
.postmetadata {display:none;}
.entry-meta {display:none !important;}
.home .entry-meta { display: none; }
.entry-footer {display:none !important;}
.home .entry-footer { display: none; }
Console error
[DOM] Found 2 elements with non-unique id #_wpnonce: (More info: https:// goo.gl/9p2vKq) <input type="hidden" id="_wpnonce" name="_wpnonce" value="65e17e3128"> <input type="hidden" id="_wpnonce" name="_wpnonce" value="2ba7a6de71">
/wordpress/wp-json/wp/v2/users/me?_locale=user:1 Failed to load resource: the server responded with a status of 404 (Not Found)
data.min.js?ver=e80048e7b309581a40e44b8bd8aaba41:2 Uncaught (in promise) Objectcode: "invalid_json"message: "The response is not a valid JSON response."__proto__: Object
There are a number of guides around on how to resolve this. Here is one example. In short, there's no one solution, this error can be caused by multiple issues that you all might have to address.
However, like for many others (here are a few), these suggestions have not fixed the problem for me when I, on multiple occasions, encountered this problem, on multiple Wordpress installs.
The few times that I had to do a deep dive into what was actually the underlying cause, each time I found that it was a specific link, inside a paragraph which, when removed, made the problem go away.
Just today, I encountered this problem on a five year old Wordpress post. The post predated Gutenberg, and was using the Classic Editor. Converting to the Block Editor, or not, made no difference.
After combing through the post, I found that removing one single link resolved the problem. The link in question:
https://www.oecd-ilibrary.org/docserver/eag-2017-en.pdf?expires=1523985351&id=id&accname=guest&checksum=5B06368AEE8D0E4FDC5531078FA481B1
Nothing really strange, as the link properly resolves. What I do notice, here, is that the link above resolves to a page, but not a pdf, as the link implies. On the page itself, the link that is provided to the document that is linked to is this:
https://read.oecd-ilibrary.org/education/education-at-a-glance-2017_eag-2017-en#page1
Replacing my offending link with the latter resolved the problem for me.
I've seen this before, a URL that seems fine, causing Wordpress to fail when trying to save a post. Perhaps this is your problem, too.
Update: I'm cleaning up old posts and found more links that resulted in posts failing to save. Several were links to PDFs, a few were Google Doc links, some were http, not https, and some were just plain links to newspaper websites.
I also found that having links set to open in new windows can result in this error, as does having anchors in the classic editor.
I bet you are on a localhost server, I had the same issue and fixed changing files permission. ALL wp-content files & folders, and ALL wp-includes folder & files must have full permissions.
If you are on localhost this is not a problem, you could simply give full permission to the entire WP installation
id
value. It also looks like you have JS that calls a REST API endpoint that doesn't exist, or, you haven't saved permalinks since the endpoint was added. Unfortunately your dev console isn't wide enough to display the full URL of those endpoints so I cannot tell which it is. Also turn off all plugins and turn them on 1 by 1 to identify the culprit – Tom J Nowell ♦ Commented Jul 30, 2020 at 14:12