• Home
  • Systems
  • Networking
  • WordPress
  • Web
  • Geekery

Analysis and Review

How to Identify WordPress mySQL Queries Per Page Load

October 18, 2014 by Kurt Turner

Here’s a quick and easy way to identify WordPress mySQL queries per page load.

1. Add the following statemnet to yout wp-config.php

[code]define(‘SAVEQUERIES’, true); [/code]

2. No add this in your wordpress theme footer.php or somewhere near the end of the wordpress loop.

[code]
<?php
if (current_user_can(‘administrator’)){
global $wpdb;
echo "<pre>";
print_r($wpdb->queries);
echo "</pre>";
}
?>[/code]

Neat ways to use this:

  1. Add this before installing pluggins, so you can see how many mySQL queries they add once activated.
  2. Use the php script to identify how many mySQL database queries your theme is using

 

Be sure to disable “savequeries” when you’re done testing your wordpress database usage.

Filed Under: Wordpress

Latest and Greatest

Apache vs Nginx for WordPress

Certbot Lets Encrypt And WordPress MU Multi-Site

How To Find and Replace Multiple File in MS Word

How To Get Stretch Res on Windows 10 AMD Radeon For Game Play

This is the ASUS Chromebox we've been running for 2 years as our "brain" for our home grown digital display kiosk.

DIY Digital Signage Bulletin Board or Kiosk

© Copyright Analysis And Review · All Rights Reserved ·