Get views for a post 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 →

Get views for a post

Read-only
Jetpack Backup & Site Management jetpack-stats/get-post-views

Return the views history and total for a single post over a chosen period.

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 returns view statistics for a single post: its total view count plus a per-period timeseries (day, week, month, or year granularity) covering a configurable number of prior periods ending on a given date. A missing or non-positive post_id returns a jetpack_stats_missing_post_id error. If the underlying WordPress.com response is missing expected period or view columns, the series is returned empty rather than guessing at positional data. Call jetpack-stats/get-top-content with type=posts first to discover post IDs worth inspecting.

See it in action

You ask your AI assistant

"How many views has post #482 gotten over the last 30 days?"

Inputs

Name Type Required Description
post_id integer Yes The post ID to fetch view history for; must be a positive numeric value.
period string No Granularity: day, week, month, or year. Defaults to day.
num integer No How many prior periods to include (1-90). Defaults to 30.
date string No End date in YYYY-MM-DD format. Defaults to today.

Returns

An object with post_id, total_views, period, num, date, and series (an array of {date, views} objects).

Permission

The current user must have the 'view_stats' capability.

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.