Sometimes our customers report us about "Are you sure you want to do this" error when they trying to install theme. The reason why this error does not provide any information is simply because there are too many factors that may lead to this problem.

Why and When 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.

Another reason is some internal server-layer errors like very low upload file size limit. In this case you're trying to upload a theme or plugin file, but your server refuses uploading process when this limit is reached. For example, if your limit is 10MB and you are uploading a file of 50MB. Uploading process will be terminated after first 10MB and WordPress won't receive any file.

Ways to fix

There is most methods to understand the root of the error and the same amount of ways to fix, but here we'll describe most common.

Deactivate all 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.

Deactivate all 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.

Increase PHP upload size limit

Firstly, make sure that your server is configured properly. You can find system requirements for your theme at it's documentation page that can be found here.

Helpful articles:

If nothing helped

First make sure you have a full backup of your website. Next, delete all WordPress files from your server except wp-content directory and all its contents. After that download a fresh copy of WordPress extract it on your computer and upload the files inside the wordpress directory to your web server.

Once you have uploaded all the files, create a new wp-config.php file in the root directory. You can look at your old wp-config.php file from the backup if you need help. 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 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',         'U%T Bb~I&cLi`(T(qn_0KU}ZbW{KmWNay+>-Zem,V,:CA-tN^ix_H`+!-]~B~y1|');
define('SECURE_AUTH_KEY',  'Jo1Z-6M}A2l&&VNwt=TVIsmPP(Yn;(R^9u;?Zn^JwPI?vxGQa Vwf^S~[HQ-*x#G');
define('LOGGED_IN_KEY',    'B*y):UFd|D`6~7,/J6Wi-[-m_^5q`pG~`+jpo:!E,?_Y%c] +j+#YnA!`t3Op$Bi');
define('NONCE_KEY',        '*LH1w~,r>^PCvDgL&--6Y:=(27<s|f~cRc+K?[(~Nuh1e,AXx+=s$o;9nxOR~wu^');
define('AUTH_SALT',        '<#m/WrWd,>j6h5z+$ t}II&m.LYeuQFWBBb/,|:TiVwSgeAD/o*+LK`6{9JO!(;g');
define('SECURE_AUTH_SALT', 'Bsdrrzwe*F#Dlx|-^NHz1Aw]MwFxZNNu~Sx/Uu:[7?TD;CQzLqh fk+_fICj}MA{');
define('LOGGED_IN_SALT',   'o-Y*?s_fB5MEUS`5qKMmVSB^_!M-z.{uYZ<Uu8-P~X#.x7t&IMKmqa:n#_,vt CL');
define('NONCE_SALT',       'rRFdogE/-:Yo7Kt]6^OICwUCeDv)Th?H+[~HF|=cEEZcDH |G~ZCZY}1)k 0:[Ef');

Save and upload your wp-config.php file. Now check your website again and try to reproduce the error.

Is this Post useful? Useful Useless 2 of 3 people say this Post is useful.