Get a Page’s or Post’s Hits

You can get the page’s or post’s hits at different periods of time by the below examples:

$page_id = 3; // Your page ID

// Get page hits
$today = wp_statistics_pages('today', $page_id);
$yesterday = wp_statistics_pages('yesterday', $page_id);
$week = wp_statistics_pages('week', $page_id);
$month = wp_statistics_pages('month', $page_id);
$year = wp_statistics_pages('year', $page_id);
$total = wp_statistics_pages('total', $page_id);
$range = wp_statistics_pages('-10', $page_id); // For the past 10 days
Let’s get started
Take your business to next level

Become part of our growing family of +600,000 users and get the tools you need to make smart choices for your website. Simple, powerful insights are just a click away.