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

Are you seeing the ‘Are you sure you want to do this?’ error on your WordPress website?

Many factors can lead to this error. This is why WordPress is unable to provide any information about how to fix it.

In this article, we will show you how to investigate and fix the ‘Are you sure you want to do this?’ error in WordPress.

Error - Are you sure you want to do this

What Causes the ‘Are You Sure You Want to Do This?” Error?

Occasionally, 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?’.

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

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

How to Fix the ‘Are You Sure You Want to Do This?’ Error

Most commonly, this error is caused by a plugin or theme that is installed on your site. Let’s take a look at how to troubleshoot the ‘Are you sure you want to do this?’ error in WordPress.

Investigate Your WordPress Plugins

First, you need to deactivate all your plugins and ensure that WordPress cannot locate any installed plugins on your website.

Simply connect to your site using an FTP client or the File Manager app in your WordPress hosting account.

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

Rename plugins folder to deactivate all plugins

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.

WordPress plugins deactivated


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 site files using an FTP agent or File Manager and rename the 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 one that is causing the issue.

This might sound time-consuming, but it is the easiest way for beginners to find a problem plugin.

Investigate Your WordPress Theme

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

You can investigate your theme by repeating the same procedure you did for plugins. First, you need to connect to your website using an FTP client or File Manager 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 the Appearance » Themes page in your WordPress admin area, and you will see a notification: ‘The active theme is broken. Reverting to the default theme’.

Theme deactivated

WordPress will now start using the default theme like Twenty Twenty-Two 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 the ‘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 neither plugins nor themes on your site are 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 because it will help you easily restore your website if something goes wrong.

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

Download wp-config.php file to your computer

After that, you need to carefully delete all WordPress files from your server.

However, do NOT delete the wp-content folder and all its contents.

Delete all WordPress files except wp-content folder

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

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

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

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

Please 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.

1234567891011121314151617/**#@+ * 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}');

Hosted with ❤️ by WPCode

1-click Use in WordPress

Now, you must 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 WordPress issues can be frustrating at times. That’s why we have prepared a handy WordPress troubleshooting guide that 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 people have faced it before you and have fixed it.

You can also 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 the “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, and check out our top picks for the best managed WordPress hosting.

Are you seeing the ‘Are you sure you want to do this?’ error on your WordPress website? Many factors can lead to this error. This is why WordPress is unable to provide any information about how to fix it. In this article, we will show you how to investigate and…

Are you seeing the ‘Are you sure you want to do this?’ error on your WordPress website? Many factors can lead to this error. This is why WordPress is unable to provide any information about how to fix it. In this article, we will show you how to investigate and…

Leave a Reply

Your email address will not be published. Required fields are marked *