Sometimes, WordPress shows an error like:
Are you sure you want to do this?
Please try again.
This if often caused by memory limitations (script runs out of memory due to multiple plugins and complex theme installed on site).
To fix this memory limits need to be increased from the default of 40M. Usually 128M fixes most setups, but 256M can be used if more is required for certain operations. This can be done from wp-config.php :
A plugin like WP Config File Editor can be used.
That doesn’t work? Error can also be caused by bad plugin and/or theme code that generates memory usage loops.
Disabling plugins and switching to a standard theme will fix the issue in this case. Then plugins/theme can be reactivated one by one to identify which one/combination is causing the issue.
Default WP setups use a virtual cron feature where maintenance and scheduled tasks occur when site scripts are triggered (when somebody visits site).
That works fine for active sites that have a fluent visitors stream. On projects where WP is not fluently visited these task don’t get triggered as expected.
Setup a real cron job from cPanel .
/usr/bin/wget -q -O – http://[yourwebsite.com]/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Can be hourly or each 15, 30 minutes.
Optionally disable WP cron from wp-config.php :
Schedule an online status monitoring service to check your WP based site. When they check they will also trigger your WP scripts.
Ex. StatusCake.com or UptimeRobot.com
WP cron triggers various functionality:
- Checking for theme & plugin updates
- Publish scheduled posts
- Sending pingbacks
- Other actions scheduled by plugins like converting videos, cleaning files or database