How to 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

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

As a website owner, there are some errors you may see in WordPress that indicate the possible cause of the error, such as “error establishing a database connection”.

However, if you get the error message “Are you sure you want to do this? Please try again”, you may not have any idea what to do about it because the message does not state any particular issue or suggest anything that is not working properly.

The reason why WordPress is showing you this unhelpful error message, “Are you sure you want to do this? Please try again” is because there are many different problems that it reports with the same message. You have to find out which of these problems is causing your error, and how to fix it.

Are you sure you want to do this? Please try again.

This article will explain the common causes of “are you sure you want to do this?” error, and steps you can take to get your site working again.

Content:

  1. An explanation for the error “Are you sure you want to do this? Please try again”
  2. The major causes of this error
  3. Six ways you can fix the “Are you sure you want to do this?” error

 

An Explanation for the Error “Are You Sure You Want to Do This? Please Try Again”

WordPress uses security tokens called nonces(random numbers) to protect URLs and forms from unauthorized access and non-validated operations. It carries out a security check by generating nonces and attaching them to the admin URL you are trying to access so that it can validate your authentication cookie information. If you do not have the correct nonce key generated by WordPress as a user, you will receive a “403 Forbidden” response with an error message “Are you sure you want to do this?” The error is basically the result of a failed security check.

 

The error will likely occur when you:

  • publish a new post or page
  • upload a new plugin or theme
  • upload media files to posts and pages
  • customize a theme
  • update WordPress core
  • create tags and categories for posts

 

The Major Causes of This Error in WordPress

  • Problem with an uploaded plugin or theme:-This problem ranges from the presence of syntax errors in the plugin or theme source code, the incompatibility of one plugin with another, and attempting to upload a theme or plugin with an incorrect file format.
  • Corrupted WordPress files
  • Exceeded PHP memory limit
  • Compromised WordPress security keys

 

Ways You Can Fix the “Are You Sure You Want to Do This?” Error

Since there are no clear pointers to the cause of the error, you will have to test the different fixes until you get rid of the error. But before going into any of them, you may want to clear your browser cache and cookies as that could be the source of your issue. You may carry out a search on how to clear cache, cookies, and history for the major browsers.

 

Deactivate all your plugins

There are two ways you can deactivate your plugins. One way is to deactivate them from your admin dashboard. Go to Plugins, Installed Plugins and select all available options. Then click on Bulk Action, select Deactivate and click Apply.

bulk deactivate plugins

The other way to deactivate all plugins is to access your WordPress directory on your cpanel or an FTP client such as FileZilla. Open the folder named wp-content, locate the plugins folder and rename it to plugins.deactivate or plugins.disable.

deactivate plugins using cpanel

Deactivate plugins using cPanel

 

deactivate plugins using ftp

Deactivate plugins using FTP

Now check your site for the error. If it is gone, you may then reactivate the plugins individually and check for the error until you find the one responsible. If you renamed the plugin folder to deactivate plugins, you will need to revert the name to “plugins” and then go on to reactivate the plugins one after the other.

 

Read this guide if you need more information: How To Disable WordPress Plugins Using FTP.

 

Increase your PHP memory limit and WordPress max post size

There is a file in the root of the WordPress directory called ‘.htaccess’, that controls how files are served. It is not advisable to remove any code from this file, but you can add code to enhance its functionality.

 

Access the folder containing your WordPress files using FTP and search for the .htaccess file.

Right click on it and select ‘view/edit’ option to download a copy of the file to your system and open it in notepad.

open htaccess for editing

Add the code below to the end of the file.

 

Php_value upload_max_filesize 1000M

Php_value post_max_size 2000M

Php_value memory_limit 3000M

Php_value max_execution_time 180

Php_value max_input_time 180

 

Next, save the file and close it. A dialog will appear asking you to upload the edited file, Click Yes. File upload size should be increased. Now go on to check if the error is fixed.

 

Check your theme uploads for syntax errors and incorrect file format

You need to first deactivate your current theme by locating its folder on your remote site, renaming the folder to a different name to deactivate it, and then falling back on a default theme to test if the error was caused by a theme instead of a plugin.

To carry out this fix, head to your cpanel or FileZilla and open the ’wp-content folder. Open the ’themes‘ folder, locate the currently active folder and rename it to deactivate it.

deactivate current wordpress theme using FTP

Deactivate current theme using FTP

 

deactivate current wordpress theme using cpanel

Deactivate current theme using cPanel

 

Fall back on a default theme such as ‘twentyseventeen’ and test if the error ‘Are you sure you want to do this?’ is fixed.

If the error was caused by the theme, then it is possible that the uploaded theme has syntax errors in its source code or has an incorrect format that is different from ‘.zip file’.

You can then upload a fresh copy of the theme to fix this error. Otherwise, if you have a custom theme, or have made many customizations to your theme, you can have a developer check your theme and fix the error. You may request our service for this.

 

Replace your WordPress core files

If all other fixes fail, you will have to replace your WordPress core files as it is known to resolve a lot of issues faced by WordPress users, including this one

  • Access your WordPress files on the server via FTP and delete all the files in the root directory except ‘wp-config.php’ and ‘wp-content’ folder

replace wordpress core files

 

  • Download a zip file of the latest version of WordPress, unzip and save it on your system.
  • See the left side of the screen, and open the folder that contains your new WordPress files.

upload wordpress core files

  • Select all the files in the folder except ‘wp-content’ folder and ‘wp-config.php’ file. Right -click on the selected files and choose upload.

upload core files using ftp

  • This fix will likely remove the error, so go ahead and check if your site works now.

 

Generate new security keys

The final fix we would recommend you attempt is to replace the WordPress security keys known as salt with new ones. The reason for this is that the existing keys may have been compromised and no longer provide the necessary security.

  • Right click on wp-config.php file via cPanel or FileZilla and select edit. This will open the file on a source code editor.
security keys in cpanel

Edit wp-config with cPanel

 

edit wp-config using ftp

Edit wp-config using FTP

  • Locate a section of the file that looks like the extract below and delete a line of code that begins with define.

define lines of code

  • Generate a new set of security keys by visiting this WordPress security keys generator
  • Copy all the code generated there for you and paste it back to the source file and save it to ‘wp-config.php’. Then attempt to reproduce the error to test whether the fix has been successful.

 

Conclusion

The error “Are you sure you want to do this? Please try again” may not exactly be easy to fix, but we hope the solutions above have helped you solve it, and get your WordPress website back to normal.

Were you able to solve this error using steps not mentioned in this guide? Then please share them with our readers in the comments below.

If you are still having this error, then it may be time to have a developer fix it for you. Request our WordPress Support Service and we will get to work to resolve this error immediately.