Your provisioning script can now install the Imunify Security plugin for WordPress on a new site as its last step, instead of leaving the site to wait for the daily job. On Imunify360, that brings WAF for WordPress to the site when provisioning finishes, rather than at the next daily run. You run install-on-new-sites --path with the account’s home directory or the site’s document root.
Why new sites waited
Once you turn the plugin on for a server, a job that runs once a day installs it on the WordPress sites created since its last run. A site created just after that run waited up to a day. The daily job keeps running as before. The command is for the sites your script creates.
The plugin’s WAF has been on by default for every site with the plugin on Imunify360 since August. On ImunifyAV and ImunifyAV+, it runs in monitoring mode, which logs attacks without blocking them.
Add one command to your provisioning script
Add it after WordPress is installed, and run it as root:
imunify360-agent wordpress-plugin install-on-new-sites --path /home/alice/public_html --json
It installs the plugin on the new WordPress sites under that path and prints one result per site, as JSON with --json. A site where the owner removed or deactivated the plugin is left alone, and the output says so. For a script, the exit code says what to do next:
- 0: the run finished. Check that your site is in the output with the status installed or already_installed. The exit code alone doesn’t confirm it. If WordPress wasn’t on the site yet when the command ran, the run finds no site and still exits with 0.
- 3: the run was refused and nothing was done. The daily job or another plugin task may be running on the server, which is likely when you provision several accounts at once. The reason is in the output.
- 11: the run didn’t finish every site: it reached its 4-minute limit, a site failed to install, or the scan for WordPress sites failed, in which case nothing was installed. A new run carries on where it stopped and doesn’t reinstall the sites it finished.
Retry on 3 and 11 a few minutes apart, up to a limit you choose, then alert someone. While the daily job runs, quick retries would all get 3.
The command runs only when your script calls it, and it handles one account per run. The plugin is still switched on per server; the command brings it to that server’s new sites sooner.
Get started
- Check that the server has it. The option arrived in imunify-core 8.15.3-1, which is on the stable channel. Imunify updates itself, so most servers already have it. If install-on-new-sites --help lists --path, yours does; if not, update as the Update Guide describes.
- Turn the plugin on for the server, if it isn’t on yet, as described in Installing the plugin in the Hosting Provider Guide.
- On ImunifyAV and ImunifyAV+, run the same command with imunify-antivirus in place of imunify360-agent.
The command is included at no extra cost with Imunify360, ImunifyAV, and ImunifyAV+.

Comments