Update Stats settings is a WordPress ability from Jetpack — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

Update Stats settings

Write
Jetpack Backup & Site Management jetpack-stats/update-settings

Update one or more Jetpack Stats settings; unspecified fields are left unchanged.

Requires the Jetpack plugin on WordPress 6.9+. Abilities are registered by several bundled Jetpack packages (automattic/jetpack-backup, jetpack-connection, jetpack-forms, jetpack-stats) plus the main plugin's own registrars for Related Posts, Shortlinks, Sitemaps, Newsletter/Subscriptions, and Monitor. Permission requirements vary by ability — most gate on 'manage_options', 'jetpack_admin_page', or 'view_stats', while Forms abilities use 'edit_pages'. Backup abilities only register when a Backup product/plan is active; Sitemaps, Monitor, and Newsletter abilities only register when their respective module is turned on.

What it does

This ability accepts any subset of Stats' four configurable settings — admin_bar, roles, count_roles, and do_not_track — and writes only the fields supplied, requiring at least one. It is idempotent: if the new values match the current ones, it returns changed=false. Whether the write actually changed anything is determined by diffing a post-write snapshot against the pre-write snapshot, so a failed or no-op underlying update is reported honestly rather than assumed. Unknown role slugs are rejected with a jetpack_stats_invalid_role(s) error, and an empty roles array is explicitly rejected since it would revoke Stats access for everyone including the caller. Because narrowing 'roles' can revoke other users' Stats access, confirm the intent with the user before applying a change here.

See it in action

You ask your AI assistant

"Turn off the Jetpack Stats admin bar item and make sure only administrators can view stats."

Inputs

Name Type Required Description
admin_bar boolean No Show the Stats item in the admin bar for users who can view Stats.
roles array No Role slugs that can view Stats. Must be non-empty and validated against registered roles.
count_roles array No Role slugs whose visits are counted toward stats. May be empty, meaning all users are counted.
do_not_track boolean No Honor the browser's Do Not Track header.

Returns

An object with changed (boolean) and settings (the full post-update settings object: admin_bar, roles, count_roles, do_not_track).

Permission

The current user must have the 'manage_options' capability — deliberately stricter than 'view_stats', since 'roles' itself controls who has view_stats access.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.