Title: Revealing WordPress&#8217;s SQL
Last modified: August 18, 2016

---

# Revealing WordPress’s SQL

 *  [cou](https://wordpress.org/support/users/cou/)
 * (@cou)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/revealing-wordpresss-sql/)
 * Hi,
 * I am having massive problems with my site – it’s painfully slow. WordPress’s 
   search function takes over 200 seconds to complete, so something is badly wrong.
   Is there a plugin which can show me all the queries WordPress runs on any given
   page, perhaps outputting it “hidden” in the comments `(<!--)`?
 * Failing that, if anyone can give me an example of the SQL used for a search query,
   with all the necessary joins etc, so I can run it on PHPMyAdmin, that would be
   terrific
 * Thanks
 * Will

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

 *  Thread Starter [cou](https://wordpress.org/support/users/cou/)
 * (@cou)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/revealing-wordpresss-sql/#post-583028)
 * Found a plugin here
 * [http://vapourtrails.ca/wp-plugins](http://vapourtrails.ca/wp-plugins)
 * It’s superb
 *  [drmike](https://wordpress.org/support/users/drmike/)
 * (@drmike)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/revealing-wordpresss-sql/#post-583034)
 * Check your theme’s footer.php file as it may already be in there, just commented
   out.
 * Example:
 * [http://mu.wordpress.org/forums/topic.php?id=2686](http://mu.wordpress.org/forums/topic.php?id=2686)
 * Here’s also a thread about listing what queries are occuring:
 * [http://wordpress.org/support/topic/83525](http://wordpress.org/support/topic/83525)
 * Things to try:
 * 1) Check your webserver’s error logs to see if you’re getting anything in there.
 * 2) Run optimize on your database.
 * 3) Make sure the box that you sit on is not overtaxed.
 * 4) Turn off all of your plugins and try again. if it works better, then turn 
   on your plugins one by run and test to see where the issue is.
 * May not exactly answer your question but it’ll get you started.
 * Hope this helps,
    -drmike

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

The topic ‘Revealing WordPress’s SQL’ is closed to new replies.

## Tags

 * [queries](https://wordpress.org/support/topic-tag/queries/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * 2 replies
 * 2 participants
 * Last reply from: [drmike](https://wordpress.org/support/users/drmike/)
 * Last activity: [18 years, 11 months ago](https://wordpress.org/support/topic/revealing-wordpresss-sql/#post-583034)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
