Skip to content

Mstoic

  • Home
  • Start Here!
  • Best Deals
  • Facebook Tricks
  • Privacy
  • Resources
  • TOC
  • Tools
    • Web Tools
      • Stop Watch
      • QR Code Generator
      • Adsense Code Converter
      • Blogger Sitemap Generator
      • Difference Between Two Texts
      • Vacation Checklist
      • Twitter Symbols
      • Count Down
    • Investment
      • SIP Calculator
      • Power of Compounding
      • PPF Calculator
      • FD Calculator
  • About Us

Display Page Load Time in WordPress Without Plugin

Editorial Team | February 6, 2015February 6, 2015 | Wordpress |

If you are a WordPress theme developer, a WP Plugin Developer, or just a WordPress blog owner who is curious to know how much time WordPress takes to load any page on the website, then there’s a simple way to figure that out.

Adding a small code snippet to your footer.php file will display the number of seconds it took WordPress to generate the page you will be looking at. You can add the snippet anywhere an in any file you want, but adding it in the footer.php file will make sure that the other content on the page appears first.

<p>WordPress took <?php timer_stop(1); ?> seconds to load the page</p>

Related Articles

  • Google Authenticator for WordPress
  • How to Edit .htaccess File from WordPress Dashboard Itself
  • Optimizing Database For WordPress Websites Automatically [Free Plugin]
  • 15 Best SEO Tips for WordPress Blogs
  • 4 Ways To Enable Gzip Compression In WordPress

Taking it a little further, you can also display the number of queries processed by WordPress to generate the page.

<p>WordPress processed <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.</p>

If you want to hide the number of queries and the time taken to generate the page from your website visitors, then you can use the code below. It first check if you are logged into WordPress as administrator, and if yes, it will display the information.

<?php if ( current_user_can('manage_options') ) : ?>   <p>WordPress processed <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.</p> <?php endif; ?>
Previous Post

Add Character Counter To Excerpt Box In WordPress

by Editorial Team

Next Post

Adding Custom Content Before/After Post Content in WordPress

by Editorial Team

Recommended Next
Customizing The Tag Cloud In WordPress

Your Comment Cancel reply

Follow Us

Like us Follow us Follow us

Categories

  • Tricks (93)
  • Facebook (83)
  • Tips (76)
  • Windows (67)
  • Wordpress (39)
  • Android (38)
  • Internet (33)
  • Antivirus (30)
  • How To (29)
  • Webmasters (25)
  • Customization (25)
  • Downloads (21)
  • Utilities (21)
  • Gmail (20)
  • Windows 7 (19)

Related Articles

  • Reverse a String using StringBuilder