Every once in a while, you might encounter a WordPress error like error establishing database connection or memory exhausted error. Those errors are somewhat helpful because they tell you exactly what the problem is. Then there are the unhelpful errors like “Are you sure you want to do this”. The reason why this error does not provide any information is simply because there are too many factors that may lead to this problem. In this article, we will show you how to investigate and fix “Are you sure you want to do this” error in WordPress.

directory-index-wp areyousureerror

Why and When “Are you sure you want to do this?” Error Appears?

This error usually occurs when WordPress checks for Nonce in an admin url and the check fails. Nonce are unique keys or numbers which can be generated by a theme, plugin, or a core WordPress file for verification purposes. Nonces add a security layer to protect WordPress URLs, forms, and ajax calls from abuse.

‘Are you sure you want to do this?’ error usually appears when nonce verification fails and the most likely candidates to cause this error are plugins and themes not using nonce properly.

Investigating “Are Your Sure You Want to Do This?” Error

Most commonly, this error is caused by a plugin or theme that is installed on your site. To investigate which plugin or theme is causing the issue, you will need todeactivate all your plugins.

Investigating Plugins

Since a deactivated plugin can still cause the issue we need to make sure that no plugins are installed in WordPress without deleting them. To do that you need to connect to your site using an FTP client and rename plugins folder in /wp-content/ directory to plugins.deactivated.

After that you need to go back to the plugins page in your WordPress admin area. You will see notification for all your plugins which are now deactivated.


Now that all your plugins are truly uninstalled and deactivated, you can try to reproduce the error. If the error does not appear again, then this means that one of the plugins on your website was causing the issue. To figure out which plugin was causing the issue, go back to your FTP client and rename plugins.deactivatedfolder back to plugins.

After that visit the plugins page in your WordPress admin area and activate your plugins one by one and try to reproduce the error after activating each plugin until you find the one causing the issue.

Yes this sounds like a dreading task, but it is the only way for beginners.

Investigating Themes

If the plugins were not causing this issue, then it might be a theme causing the problem. You can investigate the theme causing this issue by repeating the same procedure you did for plugins. First you need to connect to your website using an FTP client and download your currently active theme to your computer as a backup. Once you have backed up your theme, delete it from your web server.

Now visit Appearance » Themes page in your WordPress admin area and you will see a notifcation that ‘The active theme is broken. Reverting to the default theme’. WordPress will now start using the default theme like Twenty Thirteen for your website.

Now try to reproduce the error, if you are unable to reproduce the error then this means that your theme was causing ‘Are you sure you want to do this?’ error.

Unable to Find The Source of The Error

Make sure that you have tested thoroughly to reproduce this error after deactivating and reactivating your plugins and themes. Once you are confident that no plugin or theme on your site is causing the problem. Then there are a few extra steps you can take.

First make sure you have a full backup of your website. Next, delete all WordPress files from your server except wp-content directory and all its contents. After that download a fresh copy of WordPress extract it on your computer and upload the files inside the wordpress directory to your web server.

Once you have uploaded all the files, create a new wp-config.php file in the root directory. You can look at your old wp-config.php file from the backup if you need help. Add all sections except ‘Authentication Unique Keys and Salts’. Delete all the lines starting with define in this section.

01 /**#@+
02  * Authentication Unique Keys and Salts.
03  *
04  * Change these to different unique phrases!
05  * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
06  * 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.
07  *
08  * @since 2.6.0
09  */
10 define('AUTH_KEY',         '`+7nTNb<AwtbLA$L-Q7amn;~|wH)ljXv2~TpbP?mLA+M`8H|n1`/Lz-GmAQL{4fB');
11 define('SECURE_AUTH_KEY''/gkAjhhJe`iwO)V-p=J<cN_ +6D{YhrM|=E#C7gD}]c2w~OJ} y}eY^,HWn&-j:a');
12 define('LOGGED_IN_KEY',    'PtDl2V|01oIXDpq^K,IH-8|rhT +T(ZMpuLq>UD?|W)b3gMfG~g
13 define('NONCE_KEY',        ']Zj5i*hHlsUWKg2|>YF,X+xpd-_`I[nFmA6ZLw~;EW7g0.s5EaZCAJ=j]./5z^X~');
14 define('AUTH_SALT',        'e*l:hUsddFIxm1E7y-n#<a0|u- #+SsS@-#$vNz}EY4rY~-x|0_6=Q!TR=MMxUL?');
15 define('SECURE_AUTH_SALT', 'n]^c9nY>_}3,4)J]S sM6-MI3aB#Qk<Re^j#Lu_|x^*BhO.54aZQTtzJeCo5DWAg');
16 define('LOGGED_IN_SALT',   'Ba3kd1&J$~~`(|uJ0:v;w+DJ3xW}.B#R9J*r|.+V}*sTuK &8db-Mn+[boHW3{[/');
17 define('NONCE_SALT',       'nBv-U1qfkCZxS|13%hYdHz*s1^){.KSZWm1A^${`r!d5;EqrH:>1Xx`pwt6?**i}');

Save and upload your wp-config.php file. Now check your website again and try to reproduce the error.

We hope this article helped you fix “Are You Sure You Want to Do This” Error in WordPress.

We understand that troubleshooting such issues can be frustrating at times. Try to stay calm, and if you need help you can always send us your questions by leaving a comment below.

Content Source