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.
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 to deactivate 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.deactivated folder 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.
In Conclusion
We hope this article helped you fix “Are You Sure You Want to Do This” Error in WordPress.