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

Every once in a while, you might encounter a WordPress error like error establishing database connection or memory exhausted error. These errors are somewhat helpful because they tell you exactly what the problem is.

On the other hand, there are unhelpful errors like “Are you sure you want to do this”.

There are too many factors that can lead to this error. This is why WordPress is unable to provide any information to point you in the right direction to fix it.

In this article, we will show you how to investigate and fix “Are you sure you want to do this” error in WordPress.

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

What causes the: “Are you sure you want to do this?” error?

‘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 this feature properly.

Nonces are unique keys which add a security layer to protect WordPress URLs, forms, and ajax calls from abuse. They ensure that a script is originating from your website and not an external source like a hacker trying to gain access to your website.

How to Fix “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 to deactivate all your plugins.

Investigating Plugins

First, you need to deactivate all WordPress plugins and make sure that WordPress is unable to locate any installed plugin.

Simply connect to your WordPress hosting account using an FTP client.

Once connected, go to the wp-content folder and rename plugins folder to plugins.deactivated.

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

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

How to Fix “Are You Sure You Want to Do This” Error in WordPress
Now that all your plugins are properly 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.deactivated folder back to plugins.

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

Yes, this sounds like a time consuming task, but it is the easiest way for beginners to find a misbehaving WordPress plugin.

Investigating Themes

If the plugins were not causing this issue, then it might be your theme that is causing the ‘Are you sure you want to do this’ error.

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, you can safely delete it from your web server.

Now visit Appearance » Themes page in your WordPress admin area, and you will see a notification: ‘The active theme is broken. Reverting to the default theme’.

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

WordPress will now start using the default theme like Twenty Seventeen for your website.

If you are unable to reproduce the error after the default theme was activated, 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.

If you find out that no plugin or theme on your site is causing the error, then there are a few extra steps you can take.

These steps will basically replace all core WordPress files with fresh copies downloaded from the source.

First, you need to make a complete WordPress backup for your site. This step is important as it will help you easily restore your website in case something goes wrong.

Next, connect to your website using an FTP client and download the ‘wp-config.php’ file to your computer. This file contains your WordPress database settings which you will need later.

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

After that you need to carefully delete all WordPress files from your server except wp-content folder and all its contents.

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

After that, you need to download a fresh copy of WordPress to your computer. You can download it from WordPress.org website as a zip file.

Go ahead and extract the zip file on your computer and upload the files inside the ‘wordpress’ folder to your web server using FTP.

Once you have uploaded all the files, rename the wp-config-sample.php file to wp-config.php.

Now, you need to edit the new wp-config file to enter your WordPress database and table information. You can look at the old wp-config.php file that you downloaded earlier to enter all the information.

See our article on how to edit the wp-config.php file in WordPress for detailed instructions.

You need to add all sections except ‘Authentication Unique Keys and Salts’. Delete all the lines starting with define in this section.

/**#@+
 * 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- #[email protected]#$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}');

Now, save and upload your wp-config.php file back to your website.

That’s all, you have successfully refreshed your WordPress installation. You can now go ahead and try to reproduce the error on your website.

Basic Tips for Fixing WordPress Issues

We understand that fixing such issues can be frustrating at times. That’s why we have prepared a handy WordPress troubleshooting guide which shows you how to investigate and fix WordPress problems like a pro.

WordPress is used by millions of people. No matter what problem you come across, it is likely that thousands of other other people have faced it before you and have fixed it.

You can find a solution by simply entering the error in the Google search. For more helpful results, add wpbeginner.com at the end of your search term to find an easy step by step guide to fix it.

You can also bookmark our complete guide to common WordPress errors and how to fix them.

We hope this article helped you fix “Are You Sure You Want to Do This” Error in WordPress. You may also want to see our complete WordPress security guide to protect your website against hacking and malware.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix “Are You Sure You Want to Do This” Error in WordPress appeared first on WPBeginner.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.