Category: WordPress

WordPress REST API: cookie is invalid or nonce expired

Read this guide in Polish

After a longer period of editing, the entry record does not work despite prior login.

How to identify the source of the problem

Check the validity of the X-WP-Nonce session and header sent by REST client.

Check the bug log, recent plugin changes and the environment version on the site test copy.

Repair steps

Refresh nonce in a trusted user context or request re-log in.

How to Test Solution

The editor saves after the session has been renewed, and the request without valid nonsense is blocked.

Security and restrictions

Make a backup before you migrate or update PHP. Do not enter access data in untrusted forms.