WordPress/content
WordPress group

content

34 operations, invoked through the wordpress_manage tool.

Inside one WordPress installation: plugins, themes, core updates, users and roles, options, maintenance mode, cache, database export/import, and search-and-replace.

Discover before you call: list_wordpress_operations lists the groups, get_wordpress_module(module) returns one group's parameters, and wordpress_manage(module, operation, params, service_id, installation_id) runs it. Operations marked confirm need confirm: true in the same call; operations marked async return a task_id you poll with sites.operation_status.

content.cache_flush write installation_id#

Flush the installation's object cache.

Clears the WordPress object cache. Safe to run at any time; visitors may see slightly slower responses until the cache warms up.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { flushed: true, notices: [string] }.

content.core_check_update read installation_id#

Check whether a WordPress core update is available.

Returns the core updates available for the installation (version and whether each is a minor or major update) without applying them. Set minor to true to list only minor updates.

minorbooleanOptional
Only report minor (security/maintenance) updates. Defaults to false.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { up_to_date: boolean, updates: [ { version, update_type: "minor"|"major" } ] }.

content.core_update write installation_id#

Apply the available WordPress core update.

Updates WordPress core to the latest available version (or the latest minor release when minor is true). The site is briefly in maintenance mode during the update. Take a backup or db_export first on production sites.

minorbooleanOptional
Apply only the latest minor release. Defaults to false.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { updated: boolean, notices: [string] }.

content.core_version read installation_id#

Show the installed WordPress version.

Returns the WordPress core version currently installed. Cheap; also a good liveness check of an installation.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { version }.

content.db_export write installation_id#

Export the database to a file in the account's backup storage.

Writes a complete SQL export of the installation's database to a JetHost-managed backup folder on the hosting account, outside every web root. The file name is chosen by JetHost and returned as file; pass it to db_import to restore. The folder is reachable from the account's file manager; the server path is not returned. Run this before db_import, search_replace or core_update on a production site.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { file, size_bytes, created_at, notices: [string] } (the server path is never returned).

content.db_import write confirm installation_id#

Restore the database from a file created by db_export.

Replaces the installation's database content with the SQL file identified by file, which must have been created by db_export on the same hosting account. Current database content is overwritten. Requires confirm: true.

filestringRequired
File name exactly as returned by db_export. (pattern ^wp-[0-9]{1,12}-[0-9]{8}T[0-9]{6}Z\.sql$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { imported: true, file, notices: [string] }.

content.maintenance_disable write installation_id#

Turn maintenance mode off.

Stops showing the maintenance page. Already off is a no-op (changed: false).

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { active: false, changed: boolean, notices: [string] }.

content.maintenance_enable write installation_id#

Turn maintenance mode on.

Shows the maintenance page to visitors until maintenance_disable is called. Already on is a no-op (changed: false).

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { active: true, changed: boolean, notices: [string] }.

content.maintenance_status read installation_id#

Check whether maintenance mode is on.

Returns whether the installation currently shows the maintenance page to visitors.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { active: boolean }.

content.option_delete write confirm installation_id#

Delete one site option.

Removes the option identified by name. siteurl, home and admin_email are protected and cannot be deleted. Cannot be undone. Requires confirm: true.

namestringRequired
Option name. (maxLength 191, pattern ^[^\s-][^\x00-\x1f\x7f]{0,190}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { name, deleted: true, notices: [string] }.

content.option_get read installation_id#

Read one site option.

Returns the value of the option identified by name, as JSON (string, number, boolean, object or array). Protected options (siteurl, home, admin_email) can be read but not changed through this tool.

namestringRequired
Option name, e.g. "blogname". (maxLength 191, pattern ^[^\s-][^\x00-\x1f\x7f]{0,190}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { name, value, type }.

content.option_set write installation_id#

Create or update one site option.

Sets the option identified by name to value. By default value is stored as plain text; set format to "json" to store a JSON object, array, number or boolean given as a JSON string. siteurl, home and admin_email are protected and cannot be set here (use sites.change_domain for the address). Setting the same value again is a no-op (changed: false).

namestringRequired
Option name. (maxLength 191, pattern ^[^\s-][^\x00-\x1f\x7f]{0,190}$)
valuestringRequired
New value. With format "json", a JSON document. (maxLength 262144)
formatstringOptional
How to interpret value. Defaults to "plaintext".
One of: plaintext json

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { name, changed: boolean, notices: [string] }.

content.plugin_activate write installation_id#

Activate an installed plugin.

Activates the installed plugin identified by slug. Already active is a no-op (changed: false).

slugstringRequired
Plugin slug as shown by plugin_list. (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { slug, changed: boolean, notices: [string] }.

content.plugin_deactivate write installation_id#

Deactivate an active plugin.

Deactivates the plugin identified by slug without removing its files. Already inactive is a no-op (changed: false).

slugstringRequired
Plugin slug as shown by plugin_list. (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { slug, changed: boolean, notices: [string] }.

content.plugin_delete write confirm installation_id#

Delete a plugin's files.

Removes the plugin identified by slug from the installation. Deactivate it first if it is active. Cannot be undone; plugin settings stored in the database are not removed. Requires confirm: true.

slugstringRequired
Plugin slug as shown by plugin_list. (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { slug, deleted: boolean, notices: [string] }.

content.plugin_install write installation_id#

Install a plugin from the public plugin directory by slug.

Downloads and installs the plugin identified by slug from the public plugin directory (use directory.search_plugins to find the slug). Set activate to true to activate it immediately. Installing an already installed plugin is a no-op.

slugstringRequired
Plugin slug, e.g. "wordpress-seo". (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)
activatebooleanOptional
Activate after installing. Defaults to false.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { slug, installed: boolean, already_installed: boolean, activated: boolean, notices: [string] }.

content.plugin_install_url write confirm installation_id#

Install a plugin from a public https ZIP URL.

Downloads a plugin package from a public https URL you provide (premium or custom plugins) and installs it. The URL must be reachable from the public internet, use https, and point at a ZIP file of at most 64 MB. Set activate to true to activate it immediately. Requires confirm: true.

urlstringRequired
Public https URL of the plugin ZIP. Host name only (no port number, no credentials, no IP address literal); redirects are followed only to other https URLs. (maxLength 2048, pattern ^https://[A-Za-z0-9.-]+(/\S*)?$)
activatebooleanOptional
Activate after installing. Defaults to false.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { installed: boolean, activated: boolean, notices: [string] }.

content.plugin_list read installation_id#

List installed plugins with status, version and available update.

Returns every installed plugin with its slug (name), status (active, inactive, must-use, dropin), installed version, and the version available for update when one exists. Optionally filter by status.

statusstringOptional
Return only plugins with this status.
One of: active inactive must-use dropin

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { plugins: [ { name, title, status, version, update: "none"|"available", update_version, auto_update } ], count } (row field description from the backend is dropped).

content.plugin_update write installation_id#

Update one plugin, or all plugins, to the latest version.

Updates the plugin identified by slug to its latest available version. Omit slug to update every plugin with a pending update; on sites with many outdated plugins this may exceed the time limit, so prefer one slug per call. Returns the list of plugins actually updated with old and new versions.

slugstringOptional
Plugin slug. Omit to update all. (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { updated: [ { name, old_version, new_version, status } ], notices: [string] }.

content.rewrite_flush write installation_id#

Regenerate the permalink rewrite rules.

Regenerates the rewrite (permalink) rules of the installation. If the site has no permalink structure configured the result carries the notice "rewrite_rules_empty". Notices are fixed codes, never free text.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { flushed: true, notices: [ "rewrite_rules_empty" | "helper_notice" | "other_notice" ] }.

content.role_list read installation_id#

List the roles defined on the installation.

Returns the roles available on the installation (display name and slug). Use the slug in user_create and user_update.

No parameters.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { roles: [ { name, role } ] }.

content.search_replace write confirm installation_id#

Replace text across the installation's database.

Replaces every occurrence of search with replace across the installation's database tables (serialized data is handled safely; GUIDs are left untouched). Requires the preview_token returned by search_replace_preview for the identical search and replace terms on this installation; the previewed count is returned as would_change next to the number actually replaced. If the preview counted 0 values nothing is executed. Run db_export first; a domain move should use sites.change_domain instead. Requires confirm: true.

preview_tokenstringRequired
preview_token returned by search_replace_preview for the same search and replace terms (valid 30 minutes). (pattern ^[0-9]{1,9}\.[0-9a-f]{32}$)
replacestringRequired
Replacement text (may not start with '-'). May be empty to delete the search text. (maxLength 1024, pattern ^(|[^\x00-\x1f\x7f-][^\x00-\x1f\x7f]{0,1023})$)
searchstringRequired
Text to find (exact, case-sensitive; not a regular expression; may not start with '-'). (minLength 1, maxLength 1024, pattern ^[^\x00-\x1f\x7f-][^\x00-\x1f\x7f]{0,1023}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { would_change, replaced, search, replace, dry_run: false, notices: [string] }.

content.search_replace_preview read installation_id#

Count how many database values a search-and-replace would change, without changing anything.

Runs a dry run of replacing every occurrence of search with replace across the installation's database tables and returns the number of values that would change, plus a preview_token. Nothing is modified. Call this first, then search_replace with the identical terms, the preview_token and confirm: true. The token is valid for 30 minutes and only for this installation and these exact terms.

replacestringRequired
Replacement text (may not start with '-'). May be empty to delete the search text. (maxLength 1024, pattern ^(|[^\x00-\x1f\x7f-][^\x00-\x1f\x7f]{0,1023})$)
searchstringRequired
Text to find (exact, case-sensitive; not a regular expression; may not start with '-'). (minLength 1, maxLength 1024, pattern ^[^\x00-\x1f\x7f-][^\x00-\x1f\x7f]{0,1023}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { would_change, preview_token, search, replace, dry_run: true }.

content.theme_activate write installation_id#

Switch the site to an installed theme.

Makes the theme identified by slug the active theme. Already active is a no-op (changed: false).

slugstringRequired
Theme slug as shown by theme_list. (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { slug, changed: boolean, notices: [string] }.

content.theme_delete write confirm installation_id#

Delete an inactive theme's files.

Removes the theme identified by slug. The active theme cannot be deleted; activate another theme first. Cannot be undone. Requires confirm: true.

slugstringRequired
Theme slug as shown by theme_list. (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { slug, deleted: boolean, notices: [string] }.

content.theme_install write installation_id#

Install a theme from the public theme directory by slug.

Downloads and installs the theme identified by slug from the public theme directory (use directory.search_themes to find the slug). Set activate to true to switch the site to it immediately.

slugstringRequired
Theme slug, e.g. "astra". (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)
activatebooleanOptional
Activate after installing. Defaults to false.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { slug, installed: boolean, already_installed: boolean, activated: boolean, notices: [string] }.

content.theme_install_url write confirm installation_id#

Install a theme from a public https ZIP URL.

Downloads a theme package from a public https URL you provide (premium or custom themes) and installs it. The URL must be reachable from the public internet, use https, and point at a ZIP file of at most 64 MB. Set activate to true to switch to it immediately. Requires confirm: true.

urlstringRequired
Public https URL of the theme ZIP. Host name only (no port number, no credentials, no IP address literal); redirects are followed only to other https URLs. (maxLength 2048, pattern ^https://[A-Za-z0-9.-]+(/\S*)?$)
activatebooleanOptional
Activate after installing. Defaults to false.

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { installed: boolean, activated: boolean, notices: [string] }.

content.theme_list read installation_id#

List installed themes with status, version and available update.

Returns every installed theme with its slug (name), status (active, parent, inactive), installed version and the version available for update when one exists. Optionally filter by status.

statusstringOptional
Return only themes with this status.
One of: active parent inactive

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { themes: [ { name, title, status, version, update: "none"|"available", update_version, auto_update } ], count }.

content.theme_update write installation_id#

Update one theme, or all themes, to the latest version.

Updates the theme identified by slug to its latest available version. Omit slug to update every theme with a pending update (prefer one slug per call on large sites). Returns the themes actually updated with old and new versions.

slugstringOptional
Theme slug. Omit to update all. (pattern ^(?!.\.\.)(?!.\.[Zz][Ii][Pp]$)[A-Za-z0-9][A-Za-z0-9_.-]{0,199}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { updated: [ { name, old_version, new_version, status } ], notices: [string] }.

content.user_create write installation_id#

Create a WordPress user.

Creates a user with the given login, e-mail and role (default: the site's default role, usually subscriber). If password is omitted a strong password is generated and NOT returned; supply one if the person needs to sign in with a password, otherwise they can use the site's password-reset flow. No e-mail is sent.

emailstringRequired
E-mail address. (maxLength 100, pattern ^[^\s@-][^\s@]{0,63}@[A-Za-z0-9.-]{1,253}$)
usernamestringRequired
Login name. (pattern ^[A-Za-z0-9][A-Za-z0-9 _.@-]{0,59}$)
display_namestringOptional
Display name. (maxLength 250)
passwordstringOptional
Password (12-128 printable ASCII characters (0x20-0x7e)). Omit to generate one that is never returned. (minLength 12, maxLength 128, pattern ^[\x20-\x7e]{12,128}$)
rolestringOptional
Role slug, e.g. "editor". See role_list. (pattern ^[a-z0-9_-]{1,64}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { id, login, notices: [string] }.

content.user_delete write confirm installation_id#

Delete a user and reassign their content.

Deletes the user identified by user and reassigns all of their posts and pages to the user with numeric id reassign_to, which must exist and differ from the deleted user. Cannot be undone. Requires confirm: true.

reassign_tointegerRequired
Numeric id of the user who receives the deleted user's content. (min 1)
userstringRequired
User id, login or e-mail of the user to delete (a numeric id, a login of letters, digits, space, '_', '.', '@' or '-', or an e-mail address). (maxLength 100, pattern ^([1-9][0-9]{0,9}|[A-Za-z0-9][A-Za-z0-9 _.@-]{0,59}|[^\s@-][^\s@]{0,63}@[A-Za-z0-9.-]{1,253})$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { deleted_id, reassigned_to, notices: [string] }.

content.user_get read installation_id#

Show one WordPress user.

Returns one user identified by numeric id, login or e-mail address.

userstringRequired
User id, login or e-mail (a numeric id, a login of letters, digits, space, '_', '.', '@' or '-', or an e-mail address). (maxLength 100, pattern ^([1-9][0-9]{0,9}|[A-Za-z0-9][A-Za-z0-9 _.@-]{0,59}|[^\s@-][^\s@]{0,63}@[A-Za-z0-9.-]{1,253})$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { id, login, display_name, email, registered_at, roles: [string] }.

content.user_list read installation_id#

List WordPress users with their roles.

Returns the installation's users with id, login, display name, e-mail, registration date and roles. Optionally filter by role.

rolestringOptional
Return only users with this role, e.g. "administrator". (pattern ^[a-z0-9_-]{1,64}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { users: [ { id, login, display_name, email, registered_at, roles: [string] } ], count }.

content.user_update write installation_id#

Change a user's role or profile fields.

Updates one or more fields of the user identified by id, login or e-mail: role, email, display_name, first_name, last_name, nickname, description, url, password. At least one field is required. No e-mail is sent.

userstringRequired
User id, login or e-mail (a numeric id, a login of letters, digits, space, '_', '.', '@' or '-', or an e-mail address). (maxLength 100, pattern ^([1-9][0-9]{0,9}|[A-Za-z0-9][A-Za-z0-9 _.@-]{0,59}|[^\s@-][^\s@]{0,63}@[A-Za-z0-9.-]{1,253})$)
descriptionstringOptional
Biographical description. (maxLength 1000)
display_namestringOptional
New display name. (maxLength 250)
emailstringOptional
New e-mail address. (maxLength 100, pattern ^[^\s@-][^\s@]{0,63}@[A-Za-z0-9.-]{1,253}$)
first_namestringOptional
First name. (maxLength 250)
last_namestringOptional
Last name. (maxLength 250)
nicknamestringOptional
Nickname. (maxLength 250)
passwordstringOptional
New password (12-128 printable ASCII characters (0x20-0x7e)). (minLength 12, maxLength 128, pattern ^[\x20-\x7e]{12,128}$)
rolestringOptional
New role slug. See role_list. (pattern ^[a-z0-9_-]{1,64}$)
urlstringOptional
Website URL. (maxLength 2000, pattern ^https?://[^\s]{1,2000}$)

Returns — inside the { ok, data, errors[], warnings[] } envelope, data is { id, updated_fields: [string], notices: [string] }.