Website Errors

How to Fix “Are You Sure You Want to Do This?” in WordPress

Are you sure you want to do this?Plain English: WordPress could not verify that your action really came from you — its security check failed — so it refused to run the action instead of risking something unauthorized.
Quick answer: This message means WordPress's security verification (a one-time token called a nonce) failed. The usual fix is fast: log out and log back in, then clear your browser cookies for the site. If it persists, a security plugin, a corrupt .htaccess file, or a conflicting plugin is the culprit — the steps below walk you through each.

What Are you sure you want to do this means

You clicked Publish, Update, Install, or Save somewhere in the WordPress dashboard, and instead of completing the action you landed on a stark screen asking “Are you sure you want to do this?” with a link to go back. Nothing actually broke yet — WordPress stopped before doing anything. That is by design: it is the same kind of guard that makes your bank ask for confirmation before a transfer.

Behind the scenes, WordPress attaches a hidden, one-time security token — developers call it a nonce — to nearly every action in the admin area: publishing a post, updating a plugin, changing a setting. When your browser sends the request, WordPress checks that the token matches what it issued. If the token is missing, expired, or has been altered in transit, WordPress refuses the request rather than execute something it cannot verify came from you. This screen is simply the refusal notice.

The good news is that in practice the failure is almost always mundane: your login session quietly expired while the editor sat open, your browser's stored cookies for the site went stale or corrupt, or a plugin interfered with the request. True security breaches presenting this way are vanishingly rare. Work through the steps below in order — the first two solve it for the overwhelming majority of people, and each later step is progressively more targeted.

Common causes

How to fix Are you sure you want to do this — step by step

The whole fix takes about twenty minutes and starts with the two-minute fixes most people never get past — no coding required.

  1. Log out of WordPress and log back in. Click your profile menu in the top-right of the admin bar and choose Log Out, then log back in with your username and password. WordPress generates fresh security tokens (called nonces) for every session, and a stale or partially expired session is the single most common reason this message appears. Test the action that failed right after logging back in — for many people this one step ends the problem.
  2. Clear your browser cookies and cache for the site. Open your browser settings and delete cookies and cached data for your domain only, then reload the dashboard and try again. Corrupt or mismatched login cookies make WordPress distrust your session, which trips the same security check. As a quick diagnostic, open the site in an incognito or private window and log in there: if the error is gone, your regular browser profile's stored cookies were the culprit.
  3. Check your security plugin or firewall. If you run a security plugin such as Wordfence, Sucuri, or iThemes Security, temporarily deactivate it (or switch it to learning mode if it offers one) and test again. Over-aggressive firewall rules and login-hardening features sometimes block legitimate admin requests or strip the tokens WordPress needs, which triggers this exact message. If the error disappears, whitelist your site's admin area in the plugin's settings before turning protection back on.
  4. Restore the default .htaccess file. Using FTP or your host's file manager, rename the .htaccess file in the site root to .htaccess-backup, then go to Settings, then Permalinks in the dashboard and click Save Changes — WordPress will generate a fresh default .htaccess. Corrupted or conflicting rules left behind by old plugins can break admin form submissions. If regenerating fixes the error, compare the backup with the new file before restoring anything.
  5. Raise the PHP memory limit. Open wp-config.php in the site root and add define('WP_MEMORY_LIMIT', '256M'); just above the line that says ‘That's all, stop editing!’. Operations like publishing large posts, updating plugins, or uploading media can starve PHP of memory, and the request dies mid-flight in a way WordPress reports as a failed security check. Save the file and retry the action that was failing.
  6. Deactivate all plugins and reactivate them one by one. If the error survives every step above, connect by FTP, rename the wp-content/plugins folder to plugins-disabled, and create an empty plugins folder — this deactivates everything at once. Try the failing action; if it works, a plugin is guilty. Rename the folder back, then go to Plugins in the dashboard and reactivate each plugin one at a time, testing after each, until the error returns. Replace or leave deactivated the last plugin you turned on.

Did this fix it? Quick checklist

A word of caution before you edit server files: download a copy of .htaccess and wp-config.php to your computer first. A single typo in either file can white-screen your entire site, and having the originals on hand turns a disaster into a two-minute restore. Also, if your site is on managed WordPress hosting, check the host's dashboard first — many managed hosts offer staging, PHP settings, and file managers built in, which is far safer than hand-editing files over FTP.

Frequently asked questions

What does “Are you sure you want to do this?” mean in WordPress?

It means a security verification failed. WordPress attaches a hidden one-time token (a nonce) to actions like publishing, updating plugins, or saving settings; if the token is missing, expired, or altered when the request reaches the server, WordPress refuses the action and shows this message instead of performing something it cannot verify is really coming from you.

Why does this error appear when I try to publish or update a post?

The most common cause is a stale login session or corrupt browser cookies: the editor sat open long enough for your session tokens to expire, so the publish request fails the security check. Logging out and back in, or clearing your browser cookies for the site, fixes it in most cases. A conflicting plugin or an overzealous security plugin is the next most likely cause.

Is this error a sign my site was hacked?

Almost never — this message is WordPress protecting you, not evidence of an attack. It appears when legitimate actions fail verification, usually because of expired sessions, bad cookies, or a misbehaving plugin. That said, if the error appears on actions you never took, or your login password stopped working at the same time, change your password and run a security scan as a precaution.

I can edit posts but cannot install plugins. What is different?

Plugin and theme installs are heavier operations that are more sensitive to memory limits, execution timeouts, and file-permission problems. Raise the PHP memory limit in wp-config.php, check that the wp-content folder is writable, and temporarily deactivate your security plugin — those three fixes cover the vast majority of install-specific cases.