Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
blacklist/exclude certain page paths from results (for Google Analytics Top Content Widget)
function gtc_pages_filter_manually_remove_items( $pages ) {
$page_paths_to_exclude = array(
foreach ( $pages as $index => $page ) {
if ( in_array( $page['path'], $page_paths_to_exclude, true ) ) {
unset( $pages[ $index ] );
return $pages;
add_filter( 'gtc_pages_filter', 'gtc_pages_filter_manually_remove_items' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment