Title: Woocommerce shortcode breaks mysql database
Last modified: June 12, 2018

---

# Woocommerce shortcode breaks mysql database

 *  Resolved [annieaan](https://wordpress.org/support/users/annieaan/)
 * (@annieaan)
 * [8 years ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/)
 * Hi!
    I have a wordpress site runnings woocoomerce as an afiiliate site. The site
   has around 20 000 products atm. When I use woocommerce shortcodes it takes A 
   LOT of power from the server (a lot more than it should!). The site does not 
   have a lot of visitors. It runs on a VPS server with 32gb ram.
 * When I use a short code to display a single product based on post id it immediately(
   when adding the shortcode to a page or post) breaks the entire site.
    What is
   happening is something with the mysql call and the site gets overloaded and the
   ram gets maxed out. At first the databse stopps working and within seconds the
   entire server gets overloaded due to this mysql call.
 * Does anyone know what the issue could be?
    Is it always like this? It should 
   be possible to have 20 000 products and still a working site, right?
 * It would be great if anyone could help! 🙂
 * Kind regards Annie

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

 *  [Thomas Shellberg](https://wordpress.org/support/users/shellbeezy/)
 * (@shellbeezy)
 * Automattic Happiness Engineer
 * [8 years ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10392380)
 * [@annieaan](https://wordpress.org/support/users/annieaan/) – I haven’t ever heard
   of users suffering from performance issues when using shortcodes. Do you have
   anything from your server’s error logs that could shed some light on what exactly
   is happening?
 *  Thread Starter [annieaan](https://wordpress.org/support/users/annieaan/)
 * (@annieaan)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10401565)
 * Hi,
 * Thanks for the reply.
    I am checking the servers error logs with my host and 
   will get back ASAP. Thanks!
 * Kind regards Annie
 *  Thread Starter [annieaan](https://wordpress.org/support/users/annieaan/)
 * (@annieaan)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10401718)
 * [@shellbeezy](https://wordpress.org/support/users/shellbeezy/) – I got a reply
   from my host, they are wondering if I want them to activate the database error
   log? They say it is different error logs depending on if the error is a PHP error
   or a MySQL error. Do you know which one I need to look at?
    Thank you!
 *  Plugin Support [Ryan Ray](https://wordpress.org/support/users/ryanr14/)
 * (@ryanr14)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10404257)
 * Hi [@annieaan](https://wordpress.org/support/users/annieaan/),
 * At this point it could be either. When you said it breaks the site, do you get
   any sort of error message or perhaps just a blank screen?
 * You could also check the fatal errors or any other logs in WooCommerce > Status
   > Logs for hints.
 * Ultimately any logging or something that could point us to the likely issue is
   helpful!
 *  Thread Starter [annieaan](https://wordpress.org/support/users/annieaan/)
 * (@annieaan)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10406703)
 * Hello [@ryanr14](https://wordpress.org/support/users/ryanr14/)
 * When I add the shortcode to a page or post immediately (before I press update)
   everything stopps working in the admin area.
    Then all the pages that use the
   database (all the pages that are not cached – I use the plugin fastest cache)
   stop working. When visiting the pages that need the database it shows the message“
   Error establishing a database connection”. All the database info is correct, 
   username, password etc. One page also showed a longer mesage:
 * “Error establishing a database connection.
    This either means that the username
   or password in your wp-config.php file is incorrect or we can’t contact the database
   server at localhost. This could mean your database server is down.
 * *Are you sure you have the correct username and password?
    *Are you sure you 
   have typed the correct host name? *Are you sure that the database server is running?
 * If you’re unsure what these terms mean you should probably contact your host.
   If you still need help you could always visit the WordPress Support Forums.”
 * We have to reboot the server for it to start working again – this probably cancels
   the process that is causing the issue.
 * My host says what is happening is the server runs out of RAM and the MySQL process
   gets stuck.
 * Thanks for the help! 🙂
 * Kind regards Annie
 *  [jessepearson](https://wordpress.org/support/users/jessepearson/)
 * (@jessepearson)
 * Automattic Happiness Engineer
 * [7 years, 12 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10406962)
 * [@annieaan](https://wordpress.org/support/users/annieaan/) Can you confirm the
   shortcode you are trying to enter with all of the options? The only thing I can
   think here is that it’s trying to either load all of the products, or is trying
   to search through all of the products.
 *  Thread Starter [annieaan](https://wordpress.org/support/users/annieaan/)
 * (@annieaan)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10407114)
 * Hi [@jessepearson](https://wordpress.org/support/users/jessepearson/),
 * The shortcode is this:
 * [product id=”232324″]
 * And the database has around 20 000 products.
 * But when this is happening I am using the plugin Visual Composer -> Add Element-
   > Woo product (show a single product based on post id).
 * I also use WooCommerce shortcodes to show product categories and this works without
   breaking the site, but the pages with WooCommerce shortcodes is slower than other
   pages.
 * Also to be able to show the woocommerce categories with shortcodes our host had
   do increase memory limit – before they did that all pages with woocommerce short
   code only showed a blank white page.
 * Thanks!
 * Kind regards Annie
 *  [Thomas Shellberg](https://wordpress.org/support/users/shellbeezy/)
 * (@shellbeezy)
 * Automattic Happiness Engineer
 * [7 years, 12 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10411715)
 * > When I add the shortcode to a page or post immediately (before I press update)
   > everything stopps working in the admin area.
   >  Then all the pages that use the
   > database (all the pages that are not cached – I use the plugin fastest cache)
   > stop working.
 * Okay, since this breaks before even rendering the shortcode on the site, it might
   be an issue with the Visual Composer method of adding the shortcode.
 * What if you just add it via the normal text method and paste in `[product id=”
   232324″]`?
 *  [Kenin](https://wordpress.org/support/users/kbassart/)
 * (@kbassart)
 * Automattic Happiness Engineer
 * [7 years, 11 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10435832)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.

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

The topic ‘Woocommerce shortcode breaks mysql database’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [woocommerce shortcode](https://wordpress.org/support/topic-tag/woocommerce-shortcode/)

 * 9 replies
 * 5 participants
 * Last reply from: [Kenin](https://wordpress.org/support/users/kbassart/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/woocommerce-shortcode-breaks-mysql-database/#post-10435832)
 * Status: resolved