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

Among the errors that you might face in WordPress, the worst are the ones that do not provide even a bit of information about the cause of the error. In such cases, you are only left with an error message that is not at all informative, or in some cases, an error message might also not be displayed. It is then normal to feel a bit frustrated, especially when you are a beginner in WordPress.

One such troublesome error is what we are going to discuss in this article. That is the “Are you sure you want to do this?” error in WordPress. The problem with this error is that the reasons could be many. Troubleshooting this error is thus a tedious task. With no information available, this error is an unhelpful one. To help you in solving this error, we will try to discuss the most probable causes. We will then help you with step-by-step solutions to fix the “Are you sure you want to do this?” error in different scenarios. Having said that, let us move ahead with the article.

Causes of the “Are you sure you want to do this?” error:

Before understanding the causes, let us first understand what is a Nonce in WordPress. They can be defined simply as unique keys in WordPress. Then what is the purpose of these unique keys? They allow the addition of a security layer. This security later is intended to protect WordPress URLs, forms, and ajax calls from abuse. In more simple words, nonces in WordPress are used to ensure that a script is originating from the admin’s website. Ensuring this means securing that external sources like a hacker are not accessing your website.

We hope that you have got a brief idea about nonce in WordPress. Now, you might have been thinking that why we are discussing this here. This is because the most popular reason behind the ‘Are you sure you want to do this?’ error in WordPress is the failure of nonce verification. Now, the failure of nonce verification could have its causes. Among them, the popular ones are errors caused by plugins and themes. And it happens when a plugin or theme is not using the nonce feature properly.

Now, let us try to find the solutions for the ‘Are you sure you want to do this?’ error in WordPress in different scenarios.

Step 1:: Investigate which plugin is causing the issue:

To find out which plugin is causing the ‘Are you sure you want to do this?’ error in your WordPress website, you can follow the below steps.

  • Use an FTP client to connect to your WordPress hosting account.
  • Go to the wp-content folder.
  • Rename the plugins folder to plugins.deactivated folder.

  • This will deactivate all your WordPress plugins.
  • Go to your WordPress admin area.
  • Go to the plugins page.
  • A notification will appear for all the plugins which are now deactivated.

  • Now try to reproduce the error.
  • If one of the plugins on your website was causing the issue, the error would not appear again.
  • This is because all your plugins are currently uninstalled and deactivated.
  • Then, you need to find out the error-causing plugin.
  • Go back to your FTP client.
  • Rename the plugins.deactiva2ted folder again to plugins.
  • Go to your WordPress admin area.
  • Go to the plugins page.
  • Activate each plugin one at a time.
  • Try to reproduce the error after the activation of each plugin.
  • This way, you will ultimately find out the error-causing plugin.

If you are successful in finding out the error-causing plugin, you can try to uninstall and reinstall the respective plugin. This will hopefully solve your issue. And, if the plugins are not behind the error, you can move ahead with investigating your themes. To solve the error, you need to find the root of the error. In this respect, we will move on to our next step.

Step 2:: Investigate which theme is causing the issue:

To find out which theme is causing the ‘Are you sure you want to do this?’ error in your WordPress website, you can follow the below steps.

  • Use an FTP client to connect to your website.
  • Download your currently active theme to your system as a backup.
  • Delete the theme from your web server.
  • Go to your WordPress admin area.
  • Go to the Appearance » Themes page.
  • A notification will appear: ‘The active theme is broken. Reverting to the default theme’.

  • The default theme will thus be used for your website by WordPress.
  • Try to reproduce the error.
  • If the error is not reproduced with the default theme, then you can be sure that the problem is with the theme, that you previously deleted.

You can try reinstalling your theme. If the error still persists with that particular theme, you can also try installing some other unique themes for WordPress.

In another scenario, if you find out that the error is not caused by your theme, then you might need to move ahead with the next step mentioned in this article.

Step 3:: Investigation of the other sources of the error:

Once you are sure that the error is not caused by any of your plugins or themes, then only you should move ahead with this step. If the cause is not a plugin or theme then the next step is to delete all the core WordPress files. We will then replace them with fresh copies downloaded from the source. For doing this properly, you need to carefully follow the steps mentioned below.

  • Make a complete WordPress backup for your site.
  • You can then restore your website in case anything goes wrong.
  • Use an FTP client to connect to your website.
  • Download the ‘wp-config.php’ file to your computer.

  • All your WordPress database settings are stored in the ‘wp-config.php’ file.
  • Make sure that you are carefully going through each step, otherwise, you might face critical issues that you would not be able to solve easily.
  • Delete all WordPress files from your server except the wp-content folder and all its contents.

  • Download a fresh copy of WordPress to your computer. Download it from the WordPress.org website as a zip file.
  • Extract the zip file on your computer.
  • Use FTP to upload all the files inside the ‘WordPress’ folder to your web server.
  • Rename the wp-config-sample.php file to wp-config.php.
  • Edit the new wp-config file to enter your WordPress database and table information.
  • To enter the information, you can take help from the old wp-config.php file that you downloaded earlier.
  • Add all sections except ‘Authentication Unique Keys and Salts’.
  • In this section, you need to delete all the lines starting with define.
    /**#@+
     
    * Authentication Unique Keys and Salts.
    * Change these to different unique phrases!
    * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
    * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
    *
    * @since 2.6.0
    */
    define('AUTH_KEY', '`+7nTNb<AwtbLA$L-Q7amn;~|wH)ljXv2~TpbP?mLA+M`8H|n1`/Lz-GmAQL{4fB');
    define('SECURE_AUTH_KEY', '/gkAjhhJe`iwO)V-p=J<cN_ +6D{YhrM|=E#C7gD}]c2w~OJ} y}eY^,HWn&-j:a');
    define('LOGGED_IN_KEY', 'PtDl2V|01oIXDpq^K,IH-8|rhT +T(ZMpuLq>UD?|W)b3gMfG~g[zr8N6}m%MZ|L');
    define('NONCE_KEY', ']Zj5i*hHlsUWKg2|>YF,X+xpd-_`I[nFmA6ZLw~;EW7g0.s5EaZCAJ=j]./5z^X~');
    define('AUTH_SALT', 'e*l:hUsddFIxm1E7y-n#<a0|u- #+SsS@-#$vNz}EY4rY~-x|0_6=Q!TR=MMxUL?');
    define('SECURE_AUTH_SALT', 'n]^c9nY>_}3,4)J]S sM6-MI3aB#Qk<Re^j#Lu_|x^*BhO.54aZQTtzJeCo5DWAg');
    define('LOGGED_IN_SALT', 'Ba3kd1&J$~~`(|uJ0:v;w+DJ3xW}.B#R9J*r|.+V}*sTuK &8db-Mn+[boHW3{[/');
    define('NONCE_SALT', 'nBv-U1qfkCZxS|13%hYdHz*s1^){.KSZWm1A^${`r!d5;EqrH:>1Xx`pwt6?**i}');
  • Save the wp-config.php file.
  • Upload your wp-config.php file back to your website.
  • Now, your WordPress installation is successfully refreshed.
  • Try reproducing the error.

The error might have been successfully solved by now. You can also check our other articles on different WordPress errors.

Please follow and like us:
Content Protection by DMCA.com