2

We have a webserver with a number of WordPress instances. Most, if not all of them have disabled wp-cron.php using the wp-config.php line:

define('DISABLE_WP_CRON',true);

Despite this, there are more than a thousand requests a day that are made using wp-cron, and a typical logged request looks like this:

example.com:80 my.ip.add.res - - [19/Nov/2015:10:38:10 +0000] "POST /wp-cron.php?doing_wp_cron=1447929490.3804519176483154296875 HTTP/1.0" 404 36435 "-" "WordPress/3.9.6; http://example.com"

It's a 404 request, because after trying really hard, I have deleted wp-cron.php from the folders. I know this is more of a server management question, but where does WordPress originate the wp-cron request from? Is there any part of the code that I could modify to ensure that this is never called?

Just felt it may help to add the entire config file (barring credentials) here http://pastebin.com/4MMEw0fG

  • probably time that you upgrade your wordpress. The problem of being 4 releases behind is that no one remembers the peculiarities of old releases. – Mark Kaplun Nov 24 '15 at 5:19
  • @MarkKaplun Thank you, let me do that and report back, but I think we did have this issue in even later installations – skv Nov 24 '15 at 6:13
  • It is just strange the define is not respected. The simpliest reason might be that you have it defined to true somewhere before you define it to false. have you checked for notices? – Mark Kaplun Nov 24 '15 at 6:25
  • @MarkKaplun its almost the last line in wp-config I have the entire config in pastebin.com/4MMEw0fG – skv Nov 24 '15 at 6:37
  • Then that is the reason it doesn't work, it has to be defined before the inclusion of wp-settings.php. Including settings.php is actually executing wordpress and anything below it has no effect – Mark Kaplun Nov 24 '15 at 7:59
3

The cause is that the define in wp-config.php is below the line saying /* That's all, stop editing! Happy blogging. */

Anything defined below that is unlikely to have any impact on how wordpress works.

  • 1
    I must admit, this is truly surprising, to be very frank but for your reputation in this site I would not have even tried it, how stupid I would have been :) thanks a lot – skv Nov 24 '15 at 8:52
  • 1
    pleasure, that include of wp-settings.php at the end of wp-config.php is actually what starts wordpress and everything after it executes after wordpress had done running, so there might be some use cases to put something there but I haven't heard of one yet. – Mark Kaplun Nov 24 '15 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.