Title: Enable Admin only viewing
Last modified: August 22, 2016

---

# Enable Admin only viewing

 *  [nickweb](https://wordpress.org/support/users/nickweb/)
 * (@nickweb)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/enable-admin-only-viewing/)
 * Line 108, add the following :
 *     ```
       if ( current_user_can( 'manage_options' ) ) {
           		/* A user with admin privileges */'
       ```
   
 * BEFORE the closing PHP tag.
 * At the NEXT opening PHP tag add the following
 * `}`.
 * For ease of use, I have done the following:
 *     ```
       if ( current_user_can( 'manage_options' ) ) {
           		/* A user with admin privileges */
       		?>
   
       		<div id="wp_pls">
   
       <ul>
       <li><?php printf( __( '%s queries in %s seconds.', 'wp_pls' ), $query_count, $timer_stop ); ?></li>
       <li><?php printf( __( 'Average load time of %s (%s runs).', 'wp_pls' ), $average_load_time, sizeof( $load_times ) ); ?></li>
       <li><?php printf( __( '%s out of %s MB (%s) memory used.', 'wp_pls' ), $memory_usage, $memory_limit, round( ( $memory_usage / $memory_limit ), 2 ) * 100 . '%' ); ?></li>
       <li><?php printf( __( 'Peak memory usage %s MB.', 'wp_pls' ), $memory_peak_usage ); ?></li>
       </ul>
       			<div class="actions">
       				<a href="void(0);">×</a>
       				<a>">-</a>
       			</div>
       		</div>
       		<?php
       		} //Nick Edit - The above checks if user is an admin. If they are, shows the stats, if not, it won't.
       ```
   
 * [https://wordpress.org/plugins/wp-page-load-stats/](https://wordpress.org/plugins/wp-page-load-stats/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [adamt19](https://wordpress.org/support/users/adamt19/)
 * (@adamt19)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/enable-admin-only-viewing/#post-5261273)
 * exactly what i was looking for thx
 *  [killerdog](https://wordpress.org/support/users/killerdog/)
 * (@killerdog)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/enable-admin-only-viewing/#post-5261327)
 * Great mod, nickweb!
 * Would anyone know how to also add support to NOT display load stats on wp-admin
   pages?
 * Thanks!
 *  [killerdog](https://wordpress.org/support/users/killerdog/)
 * (@killerdog)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/enable-admin-only-viewing/#post-5261328)
 * Forget it. This was easy enough. Just update the following row:
 * From:
    `if ( current_user_can( 'manage_options' ) ) {`
 * To:
    `if ( current_user_can( 'manage_options' ) && ! is_admin() ) {`

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Enable Admin only viewing’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-page-load-stats_57b7c1.svg)
 * [WP Page Load Stats](https://wordpress.org/plugins/wp-page-load-stats/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-page-load-stats/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-page-load-stats/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-page-load-stats/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-page-load-stats/reviews/)

## Tags

 * [admin](https://wordpress.org/support/topic-tag/admin/)
 * [admin only](https://wordpress.org/support/topic-tag/admin-only/)

 * 3 replies
 * 3 participants
 * Last reply from: [killerdog](https://wordpress.org/support/users/killerdog/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/enable-admin-only-viewing/#post-5261328)
 * Status: not resolved