Documentation Guides Get a Page Stats List

Get a Page Stats List

You can make a list from Page Stats, including ID, Count, and Page Slug, by the following code:

<?php
global $wpdb, $table_prefix;
$page_slug = '%about%';
$pages     = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$table_prefix}statistics_pages` WHERE `uri` LIKE %s", $page_slug ) );

echo '<table border="1"><tr><td>ID</td><td>Count</td><td>Slug</td></tr>';
foreach ( $pages as $page ) {
	echo "<tr><td>{$page->id}</td><td>{$page->count}</td><td>{$page->uri}</td></tr>";
}
echo '</table>';