Update WordPress site automatic update settings

This function configures a WordPress cPAddon instance's automatic updates settings. If you enable automatic updates for a legacy WordPress cPAddon instance, the function will convert it to use the RPM-based WordPress cPAddon.

Important:

This function changes the instance's automatic update setting in the wp-config.php file. Before you run this function, you should verify that a filter does not exist for the automatic update settings. Use the get_instance_by_id function and view the autoupdate.core.has_filter return to determine if a filter exists.

Note:

You must install the WordPress Manager cPanel plugin to access this API function.

SecurityBasicAuth
Request
query Parameters
autoupdate.core.major
required
integer

Whether to enable automatic updates for major releases.

  • 1 - Enable.
  • 0 - Disable.
Enum: 0 1
Example: autoupdate.core.major=0
autoupdate.core.minor
required
integer

Whether to enable automatic updates for minor releases.

  • 1 - Enable.
  • 0 - Disable.
Enum: 0 1
Example: autoupdate.core.minor=0
id
required
string

The cPAddon instance's unique ID.

Note:

You can retrieve an instance ID with the get_instances function.

Example: id=cPanel__Blogs__WordPressX.0.1491917088
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/WordPressInstanceManager/configure_autoupdate
Request samples
uapi --output=jsonpretty \
  --user=username \
  WordPressInstanceManager \
  configure_autoupdate \
  id='cPanel__Blogs__WordPressX.0.1491917088' \
  autoupdate.core.major='0' \
  autoupdate.core.minor='0'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "configure_autoupdate",
  • "module": "WordPressInstanceManager",
  • "result": {
    • "data": {
      • "after": {
        • "addon_config": "/home/example/.cpaddons/cPanel::Blogs::WordPressX.0.yaml",
        • "addon_name": "cPanel::Blogs::WordPressX",
        • "addon_type": "modern",
        • "admin_url": "example.com/wordpress-41/wp-login.php",
        • "admin_username": "wpadmin",
        • "available_version": "4.9.1",
        • "current_version": "4.9.1",
        • "db_name": "example_wp1",
        • "db_prefix": "example",
        • "db_server": "localhost",
        • "db_type": "mysql",
        • "db_username": "example_wp1",
        • "domain": "example.com",
        • "full_path": "/home/example/public_html/wordpress-41",
        • "homedir": "/home/example",
        • "id": "cPanel__Blogs__WordPress.1.1509732223",
        • "initial_install_version": "4.1",
        • "migrated_from": "cPanel::Blogs::WordPress",
        • "migrated_on": 1513965986,
        • "rel_path": "wordpress-41",
        • "site_url": "example.com/wordpress-41"
        },
      • "before": {
        • "addon_config": "/home/example/.cpaddons/cPanel::Blogs::WordPressX.0.yaml",
        • "addon_name": "cPanel::Blogs::WordPress",
        • "addon_type": "legacy",
        • "admin_url": "example.com/wordpress-41/wp-login.php",
        • "admin_username": "wpadmin",
        • "available_version": "4.9.1",
        • "current_version": "4.9.1",
        • "db_name": "example_wp1",
        • "db_prefix": "example",
        • "db_server": "localhost",
        • "db_type": "mysql",
        • "db_username": "example_wp1",
        • "domain": "example.com",
        • "full_path": "/home/example/public_html/wordpress-41",
        • "homedir": "/home/example",
        • "id": "cPanel__Blogs__WordPress.1.1509732223",
        • "initial_install_version": "4.1",
        • "rel_path": "wordpress-41",
        • "site_url": "example.com/wordpress-41"
        }
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}