Fixing The "Are You Sure You Want to Do This" Error in WordPress
parallax background

Fixing The “Are You Sure You Want to Do This” Error in WordPress

Awesome VR Websites Offering a Good Look at the Future
November 19, 2022
WordPress Briefly Unavailable for Scheduled Maintenance (Solved)
March 2, 2023
Awesome VR Websites Offering a Good Look at the Future
November 19, 2022
WordPress Briefly Unavailable for Scheduled Maintenance (Solved)
March 2, 2023
 

From time to time WordPress users run into an error message. That can be stressful.

Developers may not be able to apply changes to the content. So sometimes the website becomes inaccessible to visitors.

It's crucial to fix the problem without delay. Keeping an updated backup of the site is always important and it comes in handy when trying to restore the page.

Some error messages explain what is their root cause. But that’s not the case with the “are you sure you want to do this” error.

Troubleshooting can be time-consuming, especially when you don’t know where to start.

Often it’s a new plugin or theme that triggers the issue. But there could be other actions causing the error.

This article explains what the “are you sure you want to do this” error means, the possible causes, and how to fix it.

What Is The "Are You Sure You Want to Do This" Error

 

Finding solutions requires identifying and removing the source of the problem. So it's important to understand the issue.

The "are you sure you want to do this" error means that WordPress cannot correctly read the nonce verification code of a plugin or theme.

"Nonce" stands for a "number used once". It's a security key that WordPress generates to protect URLs and forms from hack attempts.

It's added to the URL when the webmaster wants to make a change, e.g. to delete a comment. The nonce token then goes through a security check.

A failure to pass the check triggers the "are you sure you want to do this" error.

Unfortunately, the message doesn't say exactly what is the root cause. But usually, it's a new theme or plugin that the user has installed.

The way to find out is to switch the site back to the default theme.

Having the latest content backup will prevent any data loss. If the page is running again, the cause of the problem was the deactivated theme.

The "are you sure you want to do this" error could also be triggered by the following actions:

● Media upload to posts and pages

● A new post or page upload

● Theme personalization

● New tags and categories for posts

● WordPress core update

Fixing the “Are You Sure You Want to Do This” Error

As mentioned earlier, the error message doesn't specify where to look for the problem.

So there's no set approach to take to find the root cause. It may be necessary to try a few different methods.

But before starting anything, make sure your WordPress site backup is up to date.

The first thing to do is to scan the site for malware. This security check protects the page from serious harm.

Another important step is to clear the cache and cookies. The older data stored in the cache can be causing a conflict with your recent activity.

How To Disable Plugins

 

Plugins are a common cause of the “are you sure you want to do this” error. Unfortunately, there's no quick way to find the one that’s faulty.

The only solution is to deactivate all the plugins and keep checking one by one if the error reoccurs. Users can switch off plugins either from the WordPress admin area or the cPanel.

Using the Admin Dashboard To Disable Plugins

 

On the WordPress admin area go to Plugins - Installed Plugins. This will display a list of all plugins installed on your website.

Only disabling them may not solve the problem. It's necessary to first deactivate them and then uninstall them.

Having deleted a plugin, check if your site is working. Repeat the same action with the other plugins on the list until you find the one causing the error.

Some users have a lot of plugins installed on their site, so this process of checking one by one is tedious. There is an option to rename the plugins folder, delete them in bulk and check if the page is working.

This method may seem quicker. But even if the site starts running again, it’s still necessary to find out which plugin caused the error.

Using the cPanel To Disable Plugins

 

Users can disable plugins in bulk using the cPanel.

Go to the File Manager, select the "public-html" directory, and the "wp-content" folder. Here users will find a folder called "plugins".

Right-click on it and choose Rename. The new name could be, for example, "plugins.disabled".

WordPress only works with the default folder named "plugins". By changing the name, all plugins are automatically deactivated.

Next, check if the website is working again. If the error has disappeared, then it was a plugin problem.

Now it’s time to identify the broken plugin. Return to the "plugins.disabled" folder and rename it the default name "plugins".

Then reactivate the plugins one by one using the WordPress admin dashboard. Keep reloading the site until you find the faulty one.

Managing a Faulty Theme

 

Plugins are not the only source of the “are you sure you want to do this” error. The root cause could be the theme.

First, download a backup of the current theme and then disable it. Try to reload your site to see if it's working again.

If the site is running again, the deactivated theme is faulty. To manage the problem, follow these suggestions:

1. Check if there's a theme update available. If so, download it and try to activate it again. See if the error reoccurs.

 

2. Remove and then reinstall the theme and check if the site works

 

3. Delete the theme causing the error and choose a more suitable one.

Before applying any theme changes on the live site, try it first on a staging site. This allows you to test modifications without causing any issues to the live website.

Changing PHP Memory Limit And the Maximum Upload Limit

 

In other cases, the “are you sure you want to do this” error occurs when uploading a file.

The PHP memory limit and the maximum upload limit are set up by default. Trying to upload a file that exceeds those limits triggers the error.

The solution is to change the PHP memory limit and the max post size. Do this by adding code to the ".htaccess" file found in your WordPress directory root folder.

Connect to your FTP and locate the ".htaccess" file. Right-click on it and choose View/Edit.

Download the file and open it using Notepad. Next, copy this line of code and paste it at 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

Finally, save the changes and click on Yes when asked if you want to upload the edited file.

This step should fix the problem with the file upload. Try again and check if the error is gone.

WordPress Core Update

 

This article has covered the most probable causes of the “are you sure you want to do this” error. But if the message is still appearing, replace your core files and download a fresh copy of WordPress.

This step should definitely resolve the problem. Remember to create a complete WordPress backup for your website before starting.

This will make it possible to revert any changes and restore the page with ease.

 

To replace the WordPress core files, access your site via FTP. Find the "wp-config.php" file which contains the database settings.

Download the file to your computer. Next, delete all files from your server except the "wp-content" folder and all its contents.

 

Now go to WordPress.org and download a zip file of the latest WordPress version. Once it's downloaded, unzip the files and save them.

On the left side of the screen is the folder that contains the fresh WordPress files.

Open it and select all the files except "wp-content" and the "wp-config.php" file. Right-click on the selected files and upload them.

Updating the WordPress core files usually resolves the issue. Check if the website is working now.

FAQ about the "are you sure you want to do this error" in WordPress

What does the error message "Are you sure you want to do this?" mean in WordPress?

"Are you sure you want to do this?" is a generic error message that shows up when the security checks fail in WordPress. Nonce is a unique security code that WordPress makes to protect against attacks called cross-site request forgery (CSRF). When the checks for the nonce fail, WordPress thinks the request is invalid and shows the error message.

Why am I getting the "Are you sure you want to do this?" error message when trying to perform an action in WordPress?

If there is a problem with the security nonce, you may get the "Are you sure you want to do this?" error message in WordPress. This can happen if the nonce has passed its expiration date, if the nonce value in the request doesn't match the one WordPress makes, or if the nonce has been changed.

How can I fix the "Are you sure you want to do this?" error in WordPress?

To fix the "Are you sure you want to do this?" error in WordPress, try clearing your browser's cache and cookies, logging out and back in, increasing the time until the nonce expires, or turning off any plugins or themes that are causing problems.

What is a security nonce in WordPress, and how does it relate to the "Are you sure you want to do this?" error?

A security nonce is a unique code that WordPress makes to keep CSRF attacks from happening. When a WordPress user does something, the nonce is added to the request. WordPress looks at the nonce to make sure the request is good. If the check for the nonce fails, WordPress shows the error "Are you sure you want to do this?"

How do I increase the WordPress security nonce expiration time to avoid the "Are you sure you want to do this?" error?

By adding the following code to your wp-config.php file, you can make the WordPress security nonce last longer: define('NONCE SALT,' 'your-custom-nonce-salt'); This will make WordPress nonces last longer before they expire.

Can a plugin or theme cause the "Are you sure you want to do this?" error in WordPress?

Yes, a plugin or theme can cause the "Are you sure you want to do this?" error in WordPress if it conflicts with the WordPress nonce system or changes the nonce in some way.

What are some common scenarios where the "Are you sure you want to do this?" error can occur in WordPress?

In WordPress, the "Are you sure you want to do this?" error can happen when a user tries to do something that needs a nonce, like submit a form or save settings in the WordPress dashboard.

How do I troubleshoot the "Are you sure you want to do this?" error in WordPress?

To fix the "Are you sure you want to do this?" error in WordPress, you can try turning off any plugins or themes that are causing problems, increasing the time until the nonce expires, clearing your browser's cache and cookies, or looking for errors in the WordPress debug log.

Is the "Are you sure you want to do this?" error in WordPress a serious security concern?

The "Are you sure you want to do this?" error in WordPress is not a big security risk by itself, but it can be a sign of a bigger problem, like a security hole that lets an attacker get around the WordPress nonce system.

How can I prevent the "Are you sure you want to do this?" error from occurring in the future?

To avoid the "Are you sure you want to do this?" error in the future, you can make sure that your WordPress installation is up-to-date, avoid installing or using any suspicious or untrusted plugins or themes, regularly clear your browser's cache and cookies, and follow WordPress security best practises like using strong passwords, setting up two-factor authentication, and regularly backing up your site.

You can also think about using a security plugin like Wordfence or Sucuri that can help find and stop CSRF attacks.

You can also ask your web host to protect your site from CSRF attacks on the server side. By doing these things, you can lower the chance of getting the "Are you sure you want to do this?" error in WordPress and make your website safer overall.

Ending thoughts on fixing the "are you sure you Want to do this" error in WordPress

Error messages are not uncommon. They can cause trouble for developers and visitors alike. But if such troubles are irritating for you, you can use professionals' services. What's the lower price: the WordPress web design cost or your time?

This article provided the answer to why the “are you sure you want to do this” error occurs, and tips on how to fix it.

If there's an issue with the nonce security keys, in most cases it's caused by a plugin or the active theme. Sometimes it's due to the PHP memory limit and the max post size.

The solution isn't straightforward and you have to search for the source of the error. Check the plugins and the theme.

Change the PHP memory limit and the maximum upload limit. If this doesn't help, update your WordPress core files, carefully following the instructions in this article.

If you enjoyed reading this article on are you sure you want to do this error, you should check out this one about WordPress add media button not working error.

We also wrote about a few related subjects like failed to open stream error, WordPress post missed schedule, failed to load resource error, WordPress posting to Facebook done automatically, Wordpress mixed content errors, how to reorder pages in WordPress and WordPress updating failed error.

Albert Ślusarczyk
Albert Ślusarczyk
As the co-creator of Be Theme, I am a strong believer in designing with care and patience. I pour my energy, time & knowledge into perfecting the theme for our 260,000+ customers.