SERVER1 / Search

What are you looking for?

Search services, pages and articles. Results appear after 2 characters.

View all articles
Web Hosting & WordPress

WP-Cron in Plesk: Fetch a URL or Run a PHP Script?

Choose the right Plesk task mode for WP-Cron, check what belongs in the input field, and verify one due event without repeating the request.

SERVER1.GE8 min read
Clock, folder and page with a link icon beside the article title.

For an HTTP call, choose Fetch a URL

If the Plesk task is meant to call WordPress over HTTP or HTTPS, choose Fetch a URL and enter the complete web address of the site's wp-cron.php endpoint. Choose Run a PHP script only if you intend Plesk to execute the PHP file directly. The same WordPress file can be involved in both methods, but the two fields expect different inputs.

In one support case, a WordPress operator was moving from visit-triggered WP-Cron to a scheduled task in Plesk. One attempt returned HTML. Another produced a hostname-resolution error after the operator supplied a relative path from the site's document root. The customer later reported that using a complete HTTP(S) address worked.

That correction supports the HTTP approach for this case. It does not establish which mode was selected on either earlier attempt, whether a particular WordPress event finished, or whether the task later ran on schedule. If you see the same hostname error, check what the selected field expects before treating it as a DNS fault.

A person checks a laptop beside an analog desk clock.
Compare the task’s run time with the completion time of a known, harmless event.AI-generated editorial illustration · SERVER1.GE

Check what belongs in each Plesk field

Fetch a URL accepts one complete web address. For WordPress installed under /demo/, keep that directory between the hostname and wp-cron.php. The example in the table uses a reserved, nonworking hostname solely to show the format. Enter your own staging site’s full address as a single value, without curl, wget or credentials.

Run a PHP script takes a path relative to the virtual host directory. For an installation stored in the httpdocs/demo/ directory of that virtual host, enter httpdocs/demo/wp-cron.php. Do not paste the web address into this field or assume the public path /demo/wp-cron.php describes where the task can find the file.

Check the path from the subscription's point of view. If the scheduled task runs in a chroot, a path visible from the server may be unavailable to the task. For direct PHP, also confirm the PHP version and permissions used by the task. Checking the saved mode and its input without invoking WordPress is the smallest reversible next step.

How a complete scheduled-task address is assembled
InputIllustrative value
Complete address with a reserved example hostnamehttps://example.invalid/demo/wp-cron.php

Separate a wrong input from a wrong execution context

Start with the field itself. A hostname error after entering a relative file path is consistent with the value being treated as a hostname, but it does not prove that this happened. If an HTTP fetch contains a file path, correct the field before investigating DNS. If a script task contains a web address, use the verified path relative to the virtual host instead.

A correctly formatted input can still reach the wrong destination or run in the wrong context. If an HTTP task returns HTML, review the saved status, any recorded redirect destination, and existing application logs to see whether the request reached wp-cron.php on the intended WordPress installation. A sign-in or error page can come from the right site, and an HTTP 200 response alone does not confirm that the script ran. For direct PHP, seeing the file as a server administrator does not prove the scheduled task can read it. Check the saved path from the subscription's context and confirm the task's permissions and PHP version.

If your one manual run produces an unexpected redirect, login page, PHP error or inaccessible-file error, stop there. Review the saved result and authorized logs with the site owner or support. Keep raw responses and logs private. Record only the sanitized observations needed for diagnosis, and do not switch modes and fire another request just to compare.

What the available evidence tells you to check next
ObservationWhat it establishesNext check
A fetch contains a relative file path and reports a hostname errorThe input does not match the selected mode; a DNS fault is not established.Check the scheme, hostname and request path before the single test.
A correctly formed task returns a login page or reports an inaccessible fileThe intended WordPress entry point has not been confirmed.Inspect the saved result and authorized logs for the HTTP destination or PHP context.
The intended installation was reached, but there is no event completion recordWordPress was reached; event completion is still unverified.Compare the event's due time with the invocation time before diagnosing the queue.

Test once on an isolated staging site

Consider Cedar, a fictional staging site. WordPress is served under /demo/ and stored in httpdocs/demo/. The owner wants an HTTP call, so they choose Fetch a URL and enter Cedar's complete staging address for the endpoint. Before testing, they isolate the copy from competing cron triggers and check that no other due work can cause unsafe side effects. Choosing one event to observe does not stop WP-Cron from dispatching other due work.

For this hypothetical test, the owner chooses two events that perform the same harmless action but write distinct labels to a local staging log only after their work finishes. Before running the task, the owner records that event A is already due and event B is not due until after the observation window. The expected result is one new A marker and no B marker. If the owner cannot confirm that running the staging queue is safe, they stop after checking the configuration and leave execution unverified.

On the isolated staging copy, the owner notes the current end of the test log, then selects Run Now once. This checks a manual invocation, not whether Plesk will start the task at its next scheduled time. The owner records the invocation time and keeps the task result and, if available, an application log entry tied to that invocation. Compare only new markers with the expected result. If the records are incomplete, preserve what you have rather than running the task again to get clearer output.

  • Before the run, record the due times for the event you expect to finish and the one you expect to remain pending.
  • Note where you will check that the request reached the intended WordPress installation.
  • Keep the task result and the event completion record separate so you can compare them after the single invocation.

Verify the event, not just the task response

After Cedar's test, compare the saved task result with independent evidence that the intended staging installation was reached, such as an application log entry tied to the invocation. Then compare the recorded due times with the invocation time, using the same time zone. If WordPress was reached but an event was not yet due, its absence is not a dispatch failure.

Try this paper exercise without making another request: the saved response is HTTP 200, an application trace confirms entry to the intended staging installation, A was due, and neither marker appeared. The trace establishes that WordPress was reached. B's absence is expected, but it does not validate the run, and A's completion remains unverified. A new A marker tied to the invocation would support completion. If B appears before its recorded due time, check the due time, event labels, and which invocation wrote the marker before concluding that it ran early.

Record the intended result and what you actually observed. If an already-due event has no completion evidence, mark completion as unverified rather than retrying the endpoint. If the evidence does show completion, the conclusion is still limited to that event on staging. It says nothing about production or the next timed run.

If the task reached WordPress but a due event has no completion record, use our guide to diagnosing delayed WP-Cron jobs to investigate the event and its queue.

Move to one scheduler and verify its ordinary run

Have the authorized owner coordinate the change from visit-triggered WP-Cron to one deliberate scheduler. Agree on the order of changes and how to restore the previous setup if needed. The aim is to avoid both an unplanned gap with no trigger and an overlap in which page loads and Plesk trigger cron independently.

After the cutover, observe the next ordinary scheduled run instead of launching another manual request. Compare its recorded start with the intended schedule. If a known event was due, look for its completion record as well. An on-time invocation supports the timing check; completion evidence supports the event check. If nothing relevant was due, leave event completion unverified for that run.

Use the existing subscription if it offers an authorized task mode that fits the site. For the HTTP method in this case, start with Fetch a URL because the customer reported success after supplying the complete address. Choose Run a PHP script only when direct execution is the goal and the subscription can access the script. If the unresolved question is why an event that was already due has no completion record, use the wider WP-Cron guide on delayed jobs to investigate the queue from existing evidence rather than sending another request.

Before considering a move, ask support which scheduled-task options your current web hosting subscription offers for the method you intend to use.

Download the exercise

SERVER1.GE

Not sure which infrastructure fits this workload?

Tell us what you run, your expected traffic and current setup. We will help you narrow down the right option.